简体   繁体   中英

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.

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.

After careful consideration of various options, I am going with the option 2 " Receive messages from dead letter queue put back in main queue and then process it " you mentioned.

Make sure that while transferring the messages from one queue messages are not lost.

Before putting messages from DLQ to main queue, make sure that the errors faced in the main listener (mainly coding errors if any) are resolved or if any network issues are resolved.

The listener of the main queue has retried the message already and retrying it again. So please make sure to either skip already successful steps of message processing in case message is being retried. Also revert successfully processed steps in case of any errors. (This will will help in the message retry as well.)

DLQ is meant for unexpected errors. So you may have an on-demand job for doing this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM