Eventbridge - Use FIFO SQS for deduplication

Viewed 1397

I need some events to be delivered exactly once, but I have no control of the message processor (so I can‘t make the recipient idempotent).

Is it possible to route events from Eventbridge to a FIFO SQS for deduplication and from the FIFO sqs to the recipient (lambda on other account? Would this achieve exact-once delivery?

3 Answers

It EventBridge (EB) has at-least-once deliver which means you can get more then one event of the same type. But if this is not an issue, and your only concern is SQS, then yes, EB supports SQS FIFO targets:

EventBridge lets you set a variety of targets—such as Amazon SQS standard and FIFO queues—which receive events in JSON format.

It is possible, but you have to configure the FIFO queue. It can detect duplicates based on the body of the message. See this docs.

FIFO queues help you avoid sending duplicates to a queue. If you retry the SendMessage action within the 5-minute deduplication interval, Amazon SQS doesn't introduce any duplicates into the queue.

The link goes on to state what configurations are required, so be sure to check it out.

Can you set dynamically messageGroupId from the payload content when you set SQS FIFO as a target for your EventBridge rule?

From the current setup I see that it can be only a hardcoded value.

Related