1

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?

2
  • Were you able to accomplish that?
    – Rahnzo
    Commented Nov 1, 2021 at 6:34
  • @Rahnzo No actually to my surprise, I simply deleted the queue and re-created it with my Terraform script, then it solved.
    – Joy
    Commented Nov 1, 2021 at 8:36

1 Answer 1

1

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).

Not the answer you're looking for? Browse other questions tagged or ask your own question.