Hi,
Messages in a deleted queue should be sent to the dead letter exchange:
This method deletes a queue. When a queue is deleted any pending messages are sent to a dead-letter queue if this is defined in the server configuration, and all consumers on the queue are cancelled.
Unfortunately, I'm unable to achieve this behaviour.
Is this a mistake in the documentation?
Is this a mistake in the setting I'm using?
(
I've done a lot of tests, but basically, setting is done this way
- create a dead letter queue DLQ
- create a direct exchange "DLX"
- bind DLX to DLQ
- create a SingleQueue with x-dead-letter-exchange: "DLX"
- post a message
- delete the queue
=> message isn't sent to DLQ
=> if queue is configured with TTL, elapsed message are indeed sent to DLQ
)
Documentation says "if this is defined in the server configuration", but I didn't find any parameter related to dead lettering messages of deleted queues... have I missed something?
To get back to the roots of this question, here's in fact, the problem I'm trying to solve:
- in a setup with really unstable connections
- a single unstable client has it's own unique, named queue
- when this single client looses its connection to the broker, it creates a new connection and channel, than listen to the same single queue
- but as previous connection hasn't been closed nicely, RabbitMQ think he has two consumer on this single queue and load balance messages between zombie pending connection and the new active connection
I tried to solve the problem by deleting the queue after new connection is established, but this way, pending messages are lost. If dead lettering of deleted queue isn't possible with RabbitMQ, maybe there's a more natural way to solve the problem?
Thanks in advance for your answers,
Regards,
John R.