'What is the behaviour of SQS FIFO queue after visibility timeout expires?

  1. After visibility timeout expires, will the message go to same consumer or different consumer in FIFO queue?
  2. To ensure message ordering, message has to be added at the head of the queue in case of visibility timeout expiry. Is this assumption correct ? If not how message ordering is preserved when visibility timeout expires ? Please point me to any official documentation. I tried a lot in official docs to get above information but no luck.


Solution 1:[1]

I believe they behave similarly to standard queues

The FIFO queue improves upon and complements the standard queue.

If my assumption is correct, then messages stay on the queue until they are deleted. Therefore order is preserved until the message is explicitly deleted. In other words, the message is still at the head of the queue when visibility timeout expires. Upon expiry, the message is just made visible again to the consumer(s). There is no guarantee that the same consumer processes that message.

When a consumer receives and processes a message from a queue, the message remains in the queue. Amazon SQS doesn't automatically delete the message. Because Amazon SQS is a distributed system, there's no guarantee that the consumer actually receives the message

Amazon SQS visibility timeout

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1