RabbitMQ - 启动报错:received ‘false‘ but current is ‘true‘
报错详情:ERROR o.s.a.r.c.CachingConnectionFactory - Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durabl
·
报错详情:
ERROR o.s.a.r.c.CachingConnectionFactory - Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durable' for exchange 'pay.delay.exchange.direct' in vhost '/xxxx_host': received 'false' but current is 'true', class-id=40, method-id=10)
原因:
生产者消费者交换机缺省配置不一致导致,详情如下
生产者缺省配置:
如下图所示,DirectExchange构造方法中只传入了交换机名称
向上溯源,该构造方法调用的是AbstractExchange抽象类中的构造方法,构造方法中durable默认为true
消费者缺省配置:
消费者RabbitListener注解的exchange参数durable默认值为false
解决方法:
保持生产者消费者配置一致即可,例如消费者配置处加上durable = "true"
更多推荐
所有评论(0)