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
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.
The answer is "You don't". over-engineering will only get you into trouble.
Just accept the fact that a message will eventually fail and end up in a dead/poison queue and you need your monitoring systems to pick those messages up and notify the people who can investigate and resolve.
You could design and implement functions in your monitoring back-end to allow your team to inspect, edit, and replay those messages.