【Rabbitmq】报错:ERROR CachingConnectionFactory Channel shutdown: channel error;

报错内容

ERROR CachingConnectionFactory Channel shutdown: channel error; protocol method: #method(reply-code=406, reply-text=PRECONDITION_FAILED - unknown delivery tag 1, class-id=60, method-id=80)

原因 

 默认是自动ack,然后你代码又手动ack,导致ack了两次,报了错。

解决办法

 配置文件设置为手动ack

spring.rabbitmq.listener.direct.acknowledge-mode=manual

你可能感兴趣的:(rabbitmq)