I know that generally SNS is a Pub-Sub mechanism, which "duplicates" a message to all the consumers that subscribed to the published topic.
Nevertheless, I saw a field "TTL" in the SNS API, which defines the expiration fo the message (in seconds since the message was created).
I was wondering: if I publish a message to topic T with expiration of 5 minutes, and after 2 minutes, a consumer subscribe to topic T - Will the consumer get the message?
Put simply, no.
Here is what I just tried
Both phones got the second message. The first message was not sent to the second phone (even though I subscribed it well within the first message TTL, but after its publication).
No. You won't be receiving messages if you subscribe after the message is published to the SNS topic. This is because SNS doesn't retain any messages that are sent through it in the past.
Therefore once published a message, it will be delivered to the current subscribers, but not stored in a history for future subscribers by SNS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With