This is exactly how it should work. SQS FIFO maintains the order of all messages with the same group ID. To make sure that the order is preserved, if one consumer got a message with a specific group ID, no other consumer will be able to get messages with the ID until the message is deleted or becomes visible again. Otherwise, the messages can be processed out of order.
Nothing prevents a single consumer to get more than one message for the same group ID as the consumer knows the order of the messages (the order of the messages in the array) and it can process them in order.
If your code sends the messages to be processed in an asynchronous manner, you will break the order. You should process the messages one at a time. In order to process the messages quicker you should have multiple consumers, each will get messages from different groups IDs and this is how you will maintain the order and process the messages quicker.
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 years ago
- EXPERTpublished 8 months ago