Question

Is there some way that can be used to consume Amazon SQS messages in true FIFO? I tried delay message delivery from configuration but that didn't help.

Was it helpful?

Solution

Amazon SQS has just gained FIFO Queues with Exactly-Once Processing & Deduplication:

Today we are making SQS even more powerful and flexible with support for FIFO (first-in, first-out) queues. We are rolling out this new type of queue in two regions now, and plan to make it available in many others in early 2017.

These queues are designed to guarantee that messages are processed exactly once, in the order that they are sent, and without duplicates. [...]

[emphasis mine]

As emphasized, these new FIFO SQS queues will render any special considerations to consume Amazon SQS messages in true FIFO unnecessary, but are not yet available in all SQS regions [initially only in US East (Ohio) and US West (Oregon)].

OTHER TIPS

In short, no:

Q: Does Amazon SQS provide first-in-first-out (FIFO) access to messages?

No, Amazon SQS does not guarantee FIFO access to messages in Amazon SQS queues, mainly because of the distributed nature of the Amazon SQS. If you require specific message ordering, you should design your application to handle it.

http://aws.amazon.com/sqs/faqs/

Messages that need to arrive in a specific order may not be a good candidate for standard SQS queue. However you can set a message sequence counter while sending message. At receiving end, you can keep processing messages if sequence is right. In case an out of sequence message comes, wait till the right message comes and then process right sequence message and others which came in between.

enter image description here

On Nov 17th, 2016 FIFO Queue have been introduced in certain regions (US East (Ohio) and US West (Oregon)) which complements the standard queue. The order in which messages are sent and received is strictly preserved and a message is delivered once and remains available until a consumer processes and deletes it; duplicates are not introduced into the queue. FIFO queues use the same API actions as standard queues, and the mechanics for receiving and deleting messages and changing the visibility timeout are the same. However, when sending messages, you must specify a message group ID. enter image description here

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top