Hey, I have a C# service that consumes Genesys Cloud webhooks. The service is pretty stable, but occasionally it throws a 500 Internal Server Error due to a transient database lock. Genesys Cloud retries the delivery, but my service fails again because the lock isn’t released. This creates a storm of retries.
I want to implement a dead letter queue pattern. If the service fails three times, I want to push the payload to an AWS SQS queue for later processing. The problem is, Genesys Cloud doesn’t seem to have a built-in “dead letter” setting in the webhook configuration UI.
Here is the basic structure of my controller:
[HttpPost("/webhooks/genesys")]
public async Task<IActionResult> HandleWebhook([FromBody] dynamic payload)
{
try
{
await _processor.ProcessAsync(payload);
return Ok();
}
catch (Exception ex)
{
// How do I signal Genesys to stop retrying and send this to a DLQ?
return StatusCode(500, ex.Message);
}
}
If I return 500, Genesys retries. If I return 200, it assumes success. I can’t return 200 because I haven’t processed it. Is there a specific HTTP status code or header I should return to tell Genesys to drop the message? Or do I have to handle the DLQ logic entirely on my side before returning 200?