Rabbit MQ Recovery connection/channel/consumer with DLX failed

80 views
Skip to first unread message

Julien MARTIN

unread,
Jun 26, 2024, 11:54:24 AM (9 days ago) Jun 26
to rabbitmq-users
Hello

I have 2 queues, I have enabled the AutomaticRecoveryEnabled parameter set to true to allow automatic reconnection in my application.

QueueTest is the main queue that receives messages.
QueueTestRetry is the DLX queue that receives messages that the consumer cannot process, for example, during an application exception.
However, it does not work when I specify the x-dead-letter-exchange parameters. Here is the error in the logs:

operation queue.declare caused a channel exception precondition_failed: inequivalent arg 'x-dead-letter-exchange' for queue 'QueueTestRetry' in vhost '/': received none but current is the value 'tdi.retry.exchange' of type 'longstr'

The configuration of my queues is as follows:

QueueTest contains the following parameters:

x-queue-type: quorum
x-max-in-memory-length: 50
x-dead-letter-exchange: tdi.wait.exchange
x-dead-letter-routing-key: QueueTest
QueueTestRetry contains the following parameters:

x-queue-type: quorum
x-max-in-memory-length: 50
x-dead-letter-exchange: tdi.retry.exchange
x-dead-letter-routing-key: QueueTest
However, if I do not specify the x-dead-letter-exchange and x-dead-letter-routing-key parameters, the reconnection works without error.

Is the AutomaticRecoveryEnabled parameter limited when using DLX?

I'm using RabbitMQ 3.11.11

Luke Bakken

unread,
Jun 26, 2024, 3:49:40 PM (9 days ago) Jun 26
to rabbitmq-users
Hello,

Thanks for using RabbitMQ. Please see the community support policy here - https://github.com/rabbitmq/rabbitmq-server/blob/main/COMMUNITY_SUPPORT.md#who-is-eligible-for-community-support

If you would like us to assist you, please do the following:
  • Use the latest version of RabbitMQ, 3.13.x
  • Provide a complete program that we can compile and run to see this issue. Right now you haven't even told us which client library you are using (Java? .NET?)
  • Provide instructions for reproducing the issue.
Luke
Team RabbitMQ

Julien MARTIN

unread,
Jun 27, 2024, 11:09:19 AM (8 days ago) Jun 27
to rabbitmq-users
Hello

This is a complete program :  https://github.com/exile69000/RabbitMQApp.git

I'm using .NET library.

For reproducing the issue, pull rabbitmq:3-management image docker.
Run container : docker run -it --rm -p 15672:15672 -p 5672:5672 rabbitmq:3-management

Compile and execute the program. When you see a consumer on queue "QueueTest", go to Connections menu, click on the connection and close it.
Then in container log, we can see : 

issue.png

Luke Bakken

unread,
Jun 27, 2024, 12:46:28 PM (8 days ago) Jun 27
to rabbitmq-users
Thank you, I can reproduce this issue and am investigating. It is very helpful to have code!

Luke Bakken

unread,
Jun 27, 2024, 1:24:37 PM (8 days ago) Jun 27
to rabbitmq-users
Hello,

Your issue is this code:


The .NET library does not make a copy or deep clone of the arguments dictionary, so you're actually changing the arguments for when recovery happens. Don't do that. I will make sure that a clone is done in version 7 of the library.

Luke Bakken

unread,
Jun 27, 2024, 3:50:44 PM (8 days ago) Jun 27
to rabbitmq-users
https://github.com/rabbitmq/rabbitmq-dotnet-client/pull/1616

I will make a chore to back-port this to the 6.x branch. Feel free to do that yourself if you'd like, and open a pull request against 6.x.

Luke Bakken

unread,
Jun 27, 2024, 3:52:27 PM (8 days ago) Jun 27
to rabbitmq-users

Julien MARTIN

unread,
Jun 28, 2024, 8:05:18 AM (7 days ago) Jun 28
to rabbitmq-users
Thank you,  Do you know when the next release will be published?

Luke Bakken

unread,
Jun 28, 2024, 10:09:14 AM (7 days ago) Jun 28
to rabbitmq-users
No, not really. I have to review what is going into version 6.9.0.

Since there is a workaround for this issue, it doesn't seem to be high priority.

Thanks for submitting that pull request, by the way.
Reply all
Reply to author
Forward
0 new messages