RabbitMQ备用交换机和死信队列设置出现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 则不会有问题。或者通过 policy 来设置这个参数也可以不用删除队列。

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