When using SQS w/ Dead letter and Lambda , why do messages remain "in flight" for 5 min after lambda fails w/ runtime exception?
I've created 3 resources
MyQueue (configured to send undeliverable messages to MyQueueDLQ.Default visibility timeout:30 sec )
MyQueueDLQ
Lambda (retry attempts set to 0, timeout 30 seconds)
I for some reason expect (perhaps because of lack of understanding) that upon my lambda failing, the dead letter queue to receive the message shortly after failure. (instead of minutes after).
How exactly can I ensure the dead letter queue gets the message in the fastest way possible so that anything responding to the dead letter queue messages doesn't wait minutes unnecessarily?
Note: I am intentionally throwing a runtime exception in the lambda to test this so that I understand how this all works.
My goal would be to ensure that messages go to the dead letter queue as fast as possible. Is 5 min the best I can do?
Update 1: Ive set the timeout on the lambda to 5 seconds, and the timeout on the queue to 25 seconds, now it takes about 1min and 40 seconds for the message to arrive on the DLQ. Which still doesnt match my expectations. SHouldnt the message arrive on the DLQ in 25 seconds?
Update 2: So today I discovered a little info icon on the AWS Explorer SQS queue on the bottom window. This may very well describe what I am seeing
