With the introduction of FIFO queues in SQS we are guaranteed that SQS messages will be delivered in order.
Now, could there be an out-of-order delivery when I publish messages through SNS? Here's what I'm thinking that could happen:
_____ _____ __________
| App |-- Publish msg 1 --> | SNS | --> Queue msg 2 --> | FIFO SQS | --> Consume 2
| |-- Publish msg 2 --> | | --> Queue msg 1 --> | | --> Consume 1
----- ----- ----------
Is that scenario possible?
This scenario is currently impossible because SNS is not compatible with FIFO SQS in AWS. It is only supported for standard queues. This is clearly mentioned in the AWS docs in this link, under special notes.
EDIT
It's also listed in the SNS FAQs, under Are Amazon SQS FIFO queues compatible with Amazon Simple Notification Service (SNS)?
The answer's still the same as of July 26, 2020: Amazon SNS does not currently support forwarding messages to Amazon SQS FIFO queues. You can use SNS to forward messages to standard queues.