What’s the right pattern for deduplicating EventBridge events before they hit my Node.js consumer? We’re seeing double-fires for the same routing.queue.sla.breach event within a 2-second window. The event-id in the EventBridge envelope is different, but the inner id (the Genesys event ID) and traceId are identical.
Here’s the payload structure coming in:
{
"id": "evt-123",
"source": "com.genesyscloud",
"detail": {
"event_type": "routing.queue.sla.breach",
"id": "abc-789",
"traceId": "trace-xyz"
}
}
I’m using the @aws-sdk/client-lambda to invoke a handler, but that’s not the issue. The issue is processing the same breach twice. I’ve tried storing the detail.id in a DynamoDB cache with a TTL of 5 minutes, but that feels clunky for high-volume queues. Is there a native deduplication flag I’m missing in the EventBridge bus configuration? Or should I be relying on idempotency keys in the consumer logic instead? The latency on the DB check is adding up.