Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS SQS: Which is the order of message in a FIFO queue after visibility-timeout expires?

In AWS SQS FIFO's Queues; when the visibility timeout of a readed message, in which possition of the queue will be the message?

For example:

  • I have these messages in queue: '[A, B, C, D]' (order: A first in)
  • I read a message from the queue so I get message 'A'
  • The visibility timeout of message 'A' expires and it's available again for a consumer

Which will be the new order of messages?

  • a) [A, B, C, D]
  • b) [B, C, D, A]
like image 866
JBarrioGarcía Avatar asked Mar 03 '23 19:03

JBarrioGarcía


1 Answers

The order remains the same: [A, B, C, D]

In fact, it is not possible to fetch another message from the queue with the same Message Group ID until message A has been processed. This ensures that the order is preserved.

Where certain messages are allowed to be processed in parallel, you can specify a different Message Group ID.

like image 73
John Rotenstein Avatar answered Apr 11 '23 01:04

John Rotenstein