Search code examples
spring-cloud-streamspring-rabbit

While implementing dead-letter queue (DLQ), a channel error is throw


channel error; protocol method: #method(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'x-dead-letter-exchange' for queue 'ecpauditchannel.ecpqueue' in vhost 'ecp-audit': received the value 'DLX' of type 'longstr' but current is none, class-id=50, method-id=10)

The following are the configurations set in the properties file.

spring.rabbitmq.virtual-host=ecp-audit
spring.cloud.stream.bindings.ecpinputchannel.destination=ecpchannel
spring.cloud.stream.bindings.error.destination=ecpError
spring.cloud.stream.rabbit.bindings.ecpauditinputchannel.consumer.auto-bind-dlq=true
spring.cloud.stream.rabbit.bindings.input.consumer.dlq-ttl=5000

Thanks in advance


Solution

  • inequivalent arg 'x-dead-letter-exchange' for queue 'ecpauditchannel.ecpqueue' in vhost 'ecp-audit': received the value 'DLX' of type 'longstr' but current is none, class-id=50, method-id=10)

    You can't change queue arguments once a queue is created.

    but current is none,

    There is no x-dead-letter-exchange argument on the current queue.

    auto-bind-dlq=true

    Causes this argument to be set.

    You have to manually delete the existing queue (e.g. using the management console) to be able to create the new one with DLQ arguments set.