控制台報錯信息:
2019-09-24 13:05:30.145 ERROR 8444 --- [168.47.131:5672] o.s.a.r.c.CachingConnectionFactory : Channel shutdown: connection error; protocol method: #method<connection.close>(reply-code=503, reply-text=COMMAND_INVALID - unknown exchange type 'x-delayed-message', class-id=40, method-id=10) 2019-09-24 13:05:30.145 ERROR 8444 --- [168.47.131:5672] o.s.a.r.c.CachingConnectionFactory : Channel shutdown: connection error; protocol method: #method<connection.close>(reply-code=503, reply-text=COMMAND_INVALID - unknown exchange type 'x-delayed-message', class-id=40, method-id=10) 2019-09-24 13:05:30.156 INFO 8444 --- [ntContainer#0-1] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: 192.168.47.131:5672
查看Linux下rabbitmq的安裝插件:查找
rabbitmq_delayed_message_exchange
通過命令:rabbitmq-plugins list
此時並沒有找到該插件;
附:rabbitmq 插件安裝(官網)
https://www.rabbitmq.com/community-plugins.html
下載對應版本,由於我的rabbitmq是3.6.5,所以我安裝3.6.x版本;
然后開啟rabbitmq_delayed_message_exchange插件
rabbitmq-plugins enable rabbitmq_delayed_message_exchange
再次啟動項目,並無報錯信息。
https://blog.csdn.net/qq_37495786/article/details/101279491
https://www.freesion.com/article/2427422019/
Error: Channel closed by server: 406 (PRECONDITION-FAILED) with message "PRECONDITION_FAILED - Invalid argument, 'x-delayed-type' must be an existing exchange type"
這個問題困擾我了一會兒,詳情可見 Github Issues rabbitmq-delayed-message-exchange/issues/19,正確操作如下圖所示: