我遇到这个问题现象就是由于生产者发送的消息类型跟消费者接收的类型不一致导致。要解决该问题,在springboot配置文件中增加以下配置即可:
rabbitmq:
listener:
simple:
#消费失败消息干掉
default-requeue-rejected: true
retry:
#5秒
initial-interval: 5000
enabled: true
#最大重试5次
max-attempts: 5