rabbitmq-设置队列全局过期时间后不能发送消息

Posted longyao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了rabbitmq-设置队列全局过期时间后不能发送消息相关的知识,希望对你有一定的参考价值。

最开始创建队列能正常发送消息,是这样的:

技术图片

 

 能正常发送,当把上面的注释放开后,则不能发送消息,报如下错误:

com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg ‘x-message-ttl‘ for queue ‘top.name3‘ in vhost ‘/‘: received the value ‘10000‘ of type ‘long‘ but current is none, class-id=50, method-id=10)
	at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:516) ~[amqp-client-5.4.3.jar:5.4.3]
	at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:346) ~[amqp-client-5.4.3.jar:5.4.3]
	at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:178) ~[amqp-client-5.4.3.jar:5.4.3]
	at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:111) ~[amqp-client-5.4.3.jar:5.4.3]
	at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:670) ~[amqp-client-5.4.3.jar:5.4.3]
	at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:48) ~[amqp-client-5.4.3.jar:5.4.3]
	at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:597) ~[amqp-client-5.4.3.jar:5.4.3]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_92]

 

解决:

进入mq控制台删除该队列,重启应用程序

以上是关于rabbitmq-设置队列全局过期时间后不能发送消息的主要内容,如果未能解决你的问题,请参考以下文章

RabbitMQ实现延迟发送消息

RabbitMq高级特性之死信队列 通俗易懂 超详细 内含案例

RabbitMQ队列

RabbitMQ队列

Rabbitmq业务难点

.Net Core&RabbitMQ死信队列