【解決方案】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 則不會有問題。

 

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