实施死信队列 (DLQ) 时,抛出通道错误

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

频道错误;协议方法:#method(reply-code=406, reply-text=PRECONDITION_FAILED - 不等价的 arg 'x-dead-letter-exchange' for queue 'ecpauditchannel.ecpqueue' in vhost 'ecp-audit': received the value 'DLX' 类型 'longstr' 但当前是 none, class-id=50, method-id=10)

以下是属性文件中设置的配置。

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

提前致谢

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)

队列创建后便无法更改队列参数。

but current is none,

当前队列中没有 x-dead-letter-exchange 个参数。

auto-bind-dlq=true

设置此参数。

您必须删除队列才能设置不同的参数。