【解决方案】RabbitMQ中exchange和DLQ设置出现type longstr but current is none

AlternateExchange是RabbitMQ中自定义的备用交换机的名称 

Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'alternate-exchange' for exchange 'FruitDirectExchange' in vhost '/': received the value 'AlternateExchange' of type 'longstr' but current is none, class-id=40, method-id=10)

原因:queue已经存在,但是启动时试图设定一个 x-dead-letter-exchange 参数,这和服务器上的定义不一样,server 不允许所以报错。

解决方案:删除 queue 重新 declare 则不会有问题。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章