Do I have to write a one-time program that reads messages from the dead letter queue and allows me to specify the target queue for sending them?
generally speaking yes.
You can configure a delayed retry to send the message back to the original queue using a combination of the delayed messaging plugin .
but this only automates retries at intervals, and you may not have fixed the problem before retries.
in some cases, this is normal - for example, when an error is caused by the fact that an external resource is temporarily unavailable.
in your case, however, I believe that your thoughts on creating an application for processing dead letters is the best way for several reasons:
- You need to search for messages, which is impossible. RMQ
- this means that you will need a database to store messages from the DLX / queue
since you are retrieving messages from the DLX / queue, you need to make sure that you get all the header information from the message so that you can republish to the correct queue when the time comes.
Of course, I cannot be the first to encounter these problems, and I wonder if someone else has already solved them.
and you are not!
There are many solutions to this problem, they all come down to the solution that you proposed.
Some large service bus implementations have a built-in function of this type. I believe that NServiceBus (or its SaaS version) is built-in, for example - although I'm not 100% sure about this.
if you want to understand this in more detail, look for the term "poisonous message" - this is usually the term used in this situation. I found a few things on Google with a quick search that can help you with this:
hope this helps!
source share