报错代码:
by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'ACK_QUEUE' in vhost '/demo', class-id=60, method-id=20)
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:502)
at com.rabbitmq.client.impl.ChannelN.basicConsume(ChannelN.java:1378)
... 4 more
原因:
因为当前所在的虚拟主机 /demo 下没有 ACK_QUEUE 这个队列,方式很简单,添加队列即可
解决方案:
这里通过Rabbit MQ的管理页面添加队列 即可解决,方式如下图所示