- Newest
- Most votes
- Most comments
Hi Michal Tsadok,
Please go through the below documentation and steps it will helps to resolve your issue.
Message Retention Period and Dead Letter Queue:
- Message Retention Period: This specifies the duration for which a message will remain in the queue before it is automatically deleted. This does not influence whether a message is sent to a DLQ.
- Dead Letter Queue (DLQ): Messages are moved to a DLQ only when the maximum receives threshold is reached.
Handling Traffic Jams and Old Messages: To handle old messages during traffic jams, consider the following strategies:
- Extending the Message Retention Period: This allows messages to stay in the queue longer, giving more time for processing.
- Processing Efficiency: Optimize your message processing logic to handle high traffic more effectively.
- Monitoring and Alerts: Set up monitoring to detect when messages are aging and alert you to take action.
There is currently no built-in feature to move messages to a DLQ based on their age. However, you can implement a custom solution using Lambda functions to periodically check the age of messages and move older messages to a DLQ.
if there is currently no built-in feature to move messages to a DLQ based on their age - is it on the roadmap? the idea with AWS that (almost) everything works out-of-the-box - is there a way to contribute to the SQS feature :) ?
Hi,
Re DLQ retention policy, have a look at https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html#understanding-message-retention-periods
You may also want to read https://www.ranthebuilder.cloud/post/amazon-sqs-dead-letter-queues-and-failures-handling-best-practices for the best practices re. DLQ management
Best,
Didier
Message retention should be used when a message is no longer relevant after some time elapsed. You should set the max retention based on that. If message never "expire", you should set the retention to the maximum.
For this reason, it makes sense that expired messages just disappear, as they have no relevance anymore and moving them to the DLQ means that you will still try to process them.
If your traffic jam is so severe that you are not getting to your messages in 14 days (max retention), you should increase the number of consumers to process the messages faster.
Relevant content
- asked 3 years ago
- asked 8 months ago
- AWS OFFICIALUpdated 9 months ago
- AWS OFFICIALUpdated 2 years ago

There is no connection between Retention period and DLQ. If your subscriber needs more time to process the message then update the retention Period to higher number which can be upto 14 days max.