does SNS FIFO topic's message retries to SQS FIFO Queue in strict sequence?

0

We are working on one pub-sub architecture, where we want to use SNS for fan out to multiple SQS Queues. We have a requirement of strict sequence i.e. events should be in sequence for each clients. According to SNS, SQS doc we opted for FIFO topic in SNS and FIFO Queue in SQS which guarantee strict order. I also see their is a retry mechanism by SNS in case of SQS delivery failures (server/network issues)

My question is, with SNS's strong retry (over 100k times in 23 days) , will the strict sequence maintained at SQS side? i.e. will the failed messages be delivered first before any new message is delivered? Or will it be delivered in parallel?

I tried replicating SNS retry mechanism using localstack, but for no avail as they have only 3 start support for SQS and SNS(CRUD operation support), not sure if they have same retry implementation

I tried changing SQS policy in aws, but the retry is only triggered on server errors. So I wasn't able to test it out.

1 Answer
0

Hi,

The public doc answers your question: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-understanding-logic.html

If the consumer detects a failed ReceiveMessage action, it can retry as many times 
as necessary, using the same receive request attempt ID. Assuming that the consumer 
receives at least one acknowledgement before the visibility timeout expires, multiple retries don't 
affect the ordering of messages.

If you carefully re-use the attempt ID, the ordering of messages is not affected, i.e it is preserved.

Best,

Didier

profile pictureAWS
EXPERT
answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions