1
votes

I have configured an SQS FIFO queue with one publisher and three consumers. I would like to process all the messages published to the queue in order. All the messages published in the queue belong to the same group.

I have gone through the SQS documentation and understood that by configuring a suitable visibility timeout, we can ensure that only one consumer processing a message at any given time. Within the visibility timeout period, the message will not be handed over to any other consumer.

Here my question is when one message is being processed by one consumer, is there any chance that other messages in the queue get consumed by another consumer?

If yes, what is the way to ensure, at a given time only one consumer is consuming messages from queue?

1

1 Answers

1
votes

other messages in the queue get consumed by another consumer?

If they are in different message groups, then different messages can be read by other consumers. But if all your messages in the FIFO queue belong to the same group, their order and processing is guaranteed by AWS:

Messages that belong to the same message group are always processed one by one, in a strict order relative to the message group (however, messages that belong to different message groups might be processed out of order).