Search code examples
amazon-web-servicesamazon-sqs

AWS Dead letter queue redrive block incoming message redrive


I am trying to use AWS Dead Letter Queues (DLQ) and DLQ Redrive, but I need to be sure that the DLQ Redrive won't also move incoming messages.

For example, I have a Lambda function that always fails, so messages are always sent to the DLQ. If I start a DLQ Redrive, will the messages loop indefinitely until the DLQ stops? Thanks.


Solution

  • The dead-letter queues are used to isolate the problematic messages from the lambda function. This is useful because it ensures that messages are not lost and are instead preserved in the DLQ. Since the messages are preserved, it will enable us to log/alert/investigate/redrive the failed messages.

    In your specific case, if the lambda function starts throwing exceptions for all incoming messages, all the messages will be moved to the DLQ. However, if you redrive the messages without fixing the lambda function, then those messages will be once again moved back to the DLQ.

    p.s. Ideally, you should fix the problem in the lambda function before attempting to redrive the messages to the source queue.