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/ai/v1/events/5ec69550-f3fa-43b1-af49-18e3137c4f49/replay" \
-H "Authorization: Bearer $RDC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"operationId": "9d5f537d-f6af-463f-bc66-16aa81463fb5"
}' JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/ai/v1/events/5ec69550-f3fa-43b1-af49-18e3137c4f49/replay`, {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"operationId": "9d5f537d-f6af-463f-bc66-16aa81463fb5"
}),
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'POST',
f'{os.environ["RDC_BASE_URL"]}/ai/v1/events/5ec69550-f3fa-43b1-af49-18e3137c4f49/replay',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
json={
'operationId': '9d5f537d-f6af-463f-bc66-16aa81463fb5',
},
)
result = response.json() PHP
<?php
$body = <<<'JSON'
{
"operationId": "9d5f537d-f6af-463f-bc66-16aa81463fb5"
}
JSON;
$curl = curl_init(getenv('RDC_BASE_URL') . '/ai/v1/events/5ec69550-f3fa-43b1-af49-18e3137c4f49/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")}/ai/v1/events/5ec69550-f3fa-43b1-af49-18e3137c4f49/replay");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
request.Content = new StringContent("""
{
"operationId": "9d5f537d-f6af-463f-bc66-16aa81463fb5"
}
""", System.Text.Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"operationId": "9d5f537d-f6af-463f-bc66-16aa81463fb5",
"status": "accepted",
"aggregateRevision": 0
} 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