Reputation: 185
While configuring SQS FIFO queue as a target for CLoudwatch Rule, I got a warning saying "Events will be delivered to the FIFO queue at least once". I wanted to know the explanation behind this warning. In FIFO queue there aren't any duplicates so I want that use case but if I do this configuration can duplicate events be delivered to my Queue.
Upvotes: 1
Views: 1306
Reputation: 9576
According to the documentation
Unlike standard queues, FIFO queues don't introduce duplicate messages. 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.
To configure deduplication, you must do one of the following:
Enable content-based deduplication. This instructs Amazon SQS to use a SHA-256 hash to generate the message deduplication ID using the body of the message—but not the attributes of the message. For more information, see the documentation on the CreateQueue, GetQueueAttributes, and SetQueueAttributes actions in the Amazon Simple Queue Service API Reference.
Explicitly provide the message deduplication ID (or view the sequence number) for the message. For more information, see the documentation on the SendMessage, SendMessageBatch, and ReceiveMessage actions in the Amazon Simple Queue Service API Reference.
In your case event CloudWatch delivers the same message with-in 5 minutes interval it won't be duplicated in your FIFO when you enable content based deduplication.
Here is FIFO delivery logic
Upvotes: 2