AWS: Multiple SQS Reads

A simple question: I want to run an autoscale group on Amazon that runs multiple instances that process messages from the SQS queue. But how do I know that instances do not process the same messages?

I can remove a message from the queue while processing it. But if it has not yet been deleted and is still being processed by the instance, another instance may load the same message and process it, in my opinion.

+4
source share
2 answers

Besides the rather remote ability of SQS to incorrectly deliver the same message more than once (which you still need to consider, although this is unlikely), I suspect that your question is related to the lack of familiarity with the SQS concept of “timeout visibility.”

Immediately after the component receives the message, the message is still in the queue. However, you do not want other components in the system to receive and process the message again. Thus, Amazon SQS blocks them with a visibility timeout, which is the period of time during which Amazon SQS does not allow other consumer components to receive and process this message.

http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/AboutVT.html

, . , , ( " ", ). , - , SQS, - .


Update:

, SQS FIFO AWS. , , ​​ , , .

FIFO (First-In-First-Out) , , . FIFO , 300 (TPS).

http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html

FIFO - FIFO.

+10

, " ". .

+2

All Articles