Shafeel Mohammed
Shafeel Mohammed

Reputation: 53

SQS with multiple consumers and long polling enabled for FIFO type SQS

I had a question regarding SQS services.

If you have a SQS queue with multiple consumers and long polling enabled for FIFO type SQS. Which consumer gets preference for the delivery? Is it based on which started the polling first or is random? And also are there any good readings for this?

Thanks in advance!

Upvotes: 1

Views: 2862

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269081

The number of consumers does not impact operation of the Amazon SQS queue. When a consumer requests messages from a FIFO queue, they will be given the earliest unprocessed message(s).

There is an additional Message Group ID on each message. While a message with a particular Message Group ID is being processed, no further messages with the same Message Group ID will be provided. This ensures that those messages are processed in-order.

Long-polling simply means that if no messages are available, then SQS will wait up to 20 seconds before returning an empty response. Long Polling is a default value that you can override with each request to the queue.

Upvotes: 1

Related Questions