According to documentation the maximum SQS message retention period(MessageRetentionPeriod
) is 14 days. After that time message will be deleted from the queue.
Is any way with SQS to not lose these messages after their retention period expired? For example, it is not clear or is it possible to use Dead Letter Queue for this purpose?
Amazon SQS doesn't automatically delete a message after retrieving it for you, in case you don't successfully receive the message (for example, if the consumers fail or you lose connectivity).
The message retention period is the length of time that messages are kept in the message store in a final state (successful, canceled) before they are archived.
Messages in Amazon SQS have a limited amount of time to be received and processed before they are automatically deleted by SQS. If a message is not processed before the message retention period has passed, it will be permanently deleted.
SQS : Messages are persisted for some duration is no consumer available. The retention period value is from 1 minute to 14 days. The default is 4 days. SNS : No persistence.
Well 14 days is the max limit you can keep the message. After 14 days you can move that message to S3 Bucket for backup. Also there is a hack you can do with DLQ.
Here is a quick hack where you send that message back to the main queue. This is definitely not the best or recommended option.
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