0

I wanted to connect to RabbitMQ existing queue using Java JMS API. But I am getting below exception when I am trying to connect it.

Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-exchange' for queue 'TestDLXQueue2' in vhost '/': received none but current is the value 'TestDLExchnage' of type 'longstr', class-id=50, method-id=10)

RMQConnectionFactory connFactory = new RMQConnectionFactory();
Connection connection = connFactory.createConnection();
connection.start();

Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
Destination destQueue = session.createQueue("TestDLXQueue2");

If I remove the Queue and run the above snippet it worked but I have to pass the "x-dead-letter-exchange" argument in the RabbitMQ queue but I did not find a method to pass in from the JMS API.

Can anyone help me to resolve this issue without deleting the Queue?

I have tried removing the Queue and ran the above snippet it worked, Now I want to connect to the existing RabbitMQ Queue which is configured with "x-dead-letter-exchange" policy.

0 Answers0