How do I design an application such that the messages avoids the dead letter queue as much as possible.
As per wikipedia documentation below are the reasons that a message is sent to the dead letter queue
- Message that is sent to a queue that does not exist.
- Queue length limit exceeded.
- Message length limit exceeded.
- Message is rejected by another queue exchange.
- Message reaches a threshold read counter number, because it is not consumed. Sometimes this is called a "back out queue".
We will be able to design the system avoiding the known reasons. But how to make the system to address the unknown scenarios. I am not looking for any vendor specific solution but a general design guideline or recommendations.