Search code examples
amazon-web-servicesaws-sdkamazon-sqs

Process messages from Amazon SQS Dead Letter Queue


I want to process messages from an Amazon SQS Dead Letter Queue.

What is the best way to process them?

  1. Receive messages from dead letter queue and process it.
  2. Receive messages from dead letter queue put back in main queue and then process it?

I just need to process messages from dead letter queue once in a while.


Solution

  • Presumably the message ended up in the Dead Letter Queue for a reason, after failing several times.

    It would not be a good idea to put it back in the main queue because, presumably, it would fail again and you would create an infinite loop.

    Initially, dead messages should be examined manually to determine the causes of failure. Then, based on this information, an alternate flow could be developed.