0
votes

The SNS documentation FAQ's says:

SNS provides durable storage of all messages that it receives. Upon receiving a publish request, SNS stores multiple copies (to disk) of the message across multiple Availability Zones before acknowledging receipt of the request to the sender. Each AWS Region has multiple, isolated locations known as Availability Zones. Although rare, should a failure occur in one zone, the operation of SNS and the durability of your messages continue without disruption.

And

If it is critical that all published messages be successfully processed, developers should have notifications delivered to an SQS queue (in addition to notifications over other transports).

I was curious at a theoretical level, does anyone know of any conditions which would cause a message that was accepted by SNS (i.e. the API responded with a success code leading the consumer to believe the message has successfully been accepted) to be "lost", specifically when using an SQS consumer subscribed to the queue, i.e. the message isn't (and will never be) delivered to the SQS subscriber.

Footnote: I did ask this same question on server fault approx a month ago but sadly didn't get any traction on this. If the question is framed badly it'd be good to know how I can improve it.

1
It sounds like you're wondering if a message can be lost between SNS and SQS. If you've set up a subscription, then it's up to AWS to handle the transfer from SNS to SQS. I've never heard of a message being lost, and I think you'd have to ask AWS support to get a definitive answer if it's even possible for a message to be lost at that point. That being said, I'm sure AWS has put a lot of thought into making the subscriptions work correctly.Matthew Pope
I found some documentation; making this an answer.Matthew Pope

1 Answers

0
votes

Does Amazon guarantee that no messages will be lost in transit from SNS to SQS?

If you use the AWS built in subscription capability (rather than writing your own code to transfer the message), the answer is yes—all messages will be delivered successfully to SQS.

Q: Does Amazon SNS guarantee that messages are delivered to the subscribed endpoint?

... If it is critical that all published messages be successfully processed, developers should have notifications delivered to an SQS queue (in addition to notifications over other transports).

Source: Amazon SNS FAQ

The implication here is that you should have notifications delivered to an SQS queue because that is the only guaranteed way to make sure that all messages get processed.