Hey folks,
My custom webhook endpoint keeps timing out with a 504 from the Genesys platform when the downstream service is slow. I need to implement a dead letter queue pattern to retry these failed deliveries without blocking the main thread.
Here’s the current Node.js handler using Express:
app.post('/genesys-webhook', async (req, res) => {
try {
await processEvent(req.body);
res.status(200).send('OK');
} catch (error) {
console.error('Processing failed', error);
res.status(500).send('Error');
}
});
The issue is that processEvent takes longer than Genesys allows, causing the 504. I want to:
- Acknowledge receipt immediately to Genesys
- Queue the event in Redis for retry logic
- Implement exponential backoff for failed attempts
Has anyone built a reliable retry mechanism for Genesys webhooks? Looking for best practices on queue design and error handling.