2
votes

I have a lambda function triggered by an SQS queue. When the lambda fails to process a message, it redrives the message to a dead letter queue. The dead letter queue is configured with a delivery delay of 5 minutes, but any messages are visible and processed immediately.

The delivery delay seems to be getting ignored. Is this supposed to happen? Is there a way to configure a "redrive delay" for an SQS?

1
Can you share your SQS specification? Does it have a DelaySeconds value set for the seconds equivalent of 5 minutes? - Deiv
Queue 1 is set to use Queue 2's ARN as its dead letter queue. This is visible when looking at either queue in the AWS console. The delay queue's Delivery Delay in the console is displayed as 5 minutes. - Brian Manley
I would expect that delivery delay in a DLQ would be calculated from the time the message was first submitted to the original queue. If a message ends up in DLQ more than 5 minutes after it was initially enqueued in the original queue, your 5 minute timer has already elapsed, because SQS internally moves messages to the DLQ rather than "sending" them into it. Could this be what you are seeing? How much time has elapsed between original submission and dead status? - Michael - sqlbot
When testing a lambda failure scenario, maybe a few seconds pass between when the message is put in the original (non-delay) queue. The message moves to the dead letter queue in well under 5 minutes. - Brian Manley

1 Answers

0
votes

Looks like this is working as intended per this post from 2016 - https://forums.aws.amazon.com/thread.jspa?messageID=702896&#702896