(reply-code=200, reply-text=OK, class-id=0, method-id=0)的问题
解决方法:
1:可能刚刚发送消息出去,避免异步的ConfirmCallback由于资源关闭而出现clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)异常
只需要在代码后面加上:
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace();
}
2:rabbitmq 高版本中开启方式中的 publisher-confirms=“true” 已经被替换成了 confirm-type=“CORRELATED”
加上confirm-type=“CORRELATED” 这个就行
<!-- 定义rabbitmq connectionFactory 基本配置 -->
<!--confirm-type="CORRELATED" 开启确认模式-->
<!--publisher-returns="true" 开启return-->
<rabbit:connection-factory id="connectionFactory" host="${rabbitmq.host}"
port="${rabbitmq.port}"
username="${rabbitmq.username}"
password="${rabbitmq.password}"
virtual-host="${rabbitmq.virtual-host}"
confirm-type="CORRELATED"
publisher-returns="true"
/>