Search code examples
amazon-web-servicesamazon-sqs

Amazon SQS DLQ : Are sqs messages older than 14days moved to DLQ


How does the Amazon SQS's DLQ work when it comes to old messages? Do messages older than 14days() get moved to DLQ instead of being deleted ? I dont see any documentation relating to how older messages are handled.

From the documentation it looks like just the errored messages are moved to DLQ, is my assumption right ?


Solution

  • Your understanding is correct; Messages that are older than the retention period you have set (max of 14 days), will be deleted, not moved to the DLQ.

    SQS automatically deletes messages that have been in a queue for more than maximum message retention period. The default message retention period is 4 days. However, you can set the message retention period to a value from 60 seconds to 1209600 seconds (14 days) with SetQueueAttributes.

    http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/MessageLifecycle.html