RabbitMQ dead letter exchange never getting messages
dead-letter, rabbitmq
Solution
Gentilissimo Signore was kind enough to answer my question on Twitter. The problem is that if your dead letter exchange is setup as DIRECT you must specify a dead letter routing key. If you just want all your NACKed message to go into a dead letter bucket for later investigation (as I do) then your dead letter exchange should be setup as a FANOUT.
Here are the updated steps that work:
- Create new FANOUT exchange with the name "dead.letter.test"
- Create new queue "dead.letter.queue"
- Bind "dead.letter.queue" to "dead.letter.test"
- Create new queue "test1" with the dead letter exchange set to "dead.letter.test"
- Send a message into "test1"
- Nack (with requeue = false) the message in "test1"
Problem
I'm trying to setup my first RabbitMQ dead letter exchange, here are the steps I'm using through the web admin interface: - Create new DIRECT exchange with the name "dead.letter.test" - Create new queue "dead.letter.queue" - Bind "dead.letter.queue" to "dead.letter.test" - Create new queue "test1" with the dead letter exchange set to "dead.letter.test" - Send a message into "test1" - Nack (with requeue = false) the message in "test1" I am expecting that these steps should put a record into the "dead.letter.queue" through the "dead.letter.test" exchange. This is not happening. I can manually put a message into the "dead.letter.test" exchange and it shows up in "dead.letter.queue" so I know that is fine. When I look at the admin UI it shows that the DLX parameter is setup on the queue "test1". Where am I going wrong?