We’ve hooked up our Genesys Cloud org to AWS EventBridge. The goal is to trigger a Kotlin-based Lambda function whenever a new chat conversation starts. The setup works, but the deduplication is broken. I’m seeing the exact same CONVERSATION_CREATED event fire twice, sometimes three times, within a 2-second window.
I checked the event JSON in CloudWatch. The eventTime is identical, and the conversationId matches perfectly. It looks like a race condition in the bridge or maybe our subscription filter is too loose. Here’s the relevant snippet from the Lambda handler:
fun handler(event: S3Event, context: Context) {
val records = event.records
for (record in records) {
val payload = record.s3.object().key
// Processing logic...
}
}
I tried adding a check for event.detail.conversationId against a DynamoDB table, but the latency on the DB call is causing issues. Is there a standard pattern for idempotency here? Or should I be looking at the eventSource field to filter out retries? The docs don’t mention retry behavior for EventBridge rules. I don’t want to process the same chat twice and send duplicate notifications.