Replay
Send a parked event again once your endpoint is ready to take it.
An event is parked after its last failed attempt (Delivery and retries). Replay an event sends a parked event again.
curl
curl -X POST "$RDC_BASE_URL/pos/v1/deliveries/2286b6eb-e420-425e-b7d3-aabb6c4bfc56/replay" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "bd75f154-3867-48cb-a4fe-bc314b25e1a8"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/pos/v1/deliveries/2286b6eb-e420-425e-b7d3-aabb6c4bfc56/replay`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "bd75f154-3867-48cb-a4fe-bc314b25e1a8"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/pos/v1/deliveries/2286b6eb-e420-425e-b7d3-aabb6c4bfc56/replay',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': 'bd75f154-3867-48cb-a4fe-bc314b25e1a8',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "bd75f154-3867-48cb-a4fe-bc314b25e1a8"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/pos/v1/deliveries/2286b6eb-e420-425e-b7d3-aabb6c4bfc56/replay');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => $body,
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/pos/v1/deliveries/2286b6eb-e420-425e-b7d3-aabb6c4bfc56/replay");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "bd75f154-3867-48cb-a4fe-bc314b25e1a8"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "bd75f154-3867-48cb-a4fe-bc314b25e1a8",
"status": "accepted",
"aggregateId": "2286b6eb-e420-425e-b7d3-aabb6c4bfc56",
"aggregateRevision": 5
} What to expect
- The replayed event is the same event, with the same
id. If you handled it, skip it. - A replay starts a new series of delivery attempts.
- Replay in the order of
aggregateRevisionfor one record, so the state you hold ends up current.
The full rule: Developer guide