Spring boot Spring bus rabbit amqp客户端在长时间处于空闲状态时断开连接
我已经使用amqp mvn通过spring引导服务设置了rabbitmq 框架,以便我可以远程刷新配置。事情进展顺利 起初,但随后连接中断 下面的错误堆栈 另链接:Spring boot Spring bus rabbit amqp客户端在长时间处于空闲状态时断开连接,spring-boot,rabbitmq,spring-amqp,spring-cloud-bus,Spring Boot,Rabbitmq,Spring Amqp,Spring Cloud Bus,我已经使用amqp mvn通过spring引导服务设置了rabbitmq 框架,以便我可以远程刷新配置。事情进展顺利 起初,但随后连接中断 下面的错误堆栈 另链接: 2018-05-22 17:10:49.647错误9---[X.X.228:5671]c.r.c.impl.CreditingExceptionHandler:发生意外的连接驱动程序错误 com.rabbitmq.client.MissedHeartbeatException:Heartbeat missing with Heart
2018-05-22 17:10:49.647错误9---[X.X.228:5671]c.r.c.impl.CreditingExceptionHandler:发生意外的连接驱动程序错误
com.rabbitmq.client.MissedHeartbeatException:Heartbeat missing with Heartbeat=10秒位于com.rabbitmq.client.impl.AMQConnection.handleSocketTimeout(AMQConnection.java:723)com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:642)com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:47)位于com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:572),位于java.lang.Thread.run(Thread.java:745)
2018-05-22 17:10:49.652错误9-[X.X.228:5671]o.s.a.r.c.CachingConnectionFactory:通道关闭:连接错误2018-05-22 17:10:49.652错误9-[X.X.228:5671]o.s.a.r.c.CachingConnectionFactory:通道关闭:连接错误2018-05-22 17:10:50.581信息9-[NiW8BAjOWTiVA-1]o.s.a.r.l.SimpleMessageListenerContainer:重新启动Consumer@574b7f4a:tags=[{amq.ctag-m35nyazob0vmhjhwaydmg=springCloudBus.anonymous.ev7zclslsniw8bajowtiva}],channel=Cached兔通道:AMQChannel(amqp://admin@10.X.X.228:5671/,1),康涅狄格州:Proxy@76ad6715共享兔子连接:SimpleConnection@5a1c3cb4 [代表=amqp://admin@10.X.X.228:5671/,localPort=43472],acknowledgeMode=AUTO-local queue size=0 2018-05-22 17:10:50.609信息9---[NiW8BAjOWTiVA-2]o.s.a.r.c.CachingConnectionFactory:创建的新连接:rabbitConnectionFactory#934b52f:1/SimpleConnection@3cd111c6[代表=amqp://admin@10.X.X.78:5671/,localPort=50792]2018-05-22 17:10:50.613信息9---[NiW8BAjOWTiVA-2]o.s.amqp.rabbit.core.RabbitAdmin:自动声明非持久、自动删除或独占队列(springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA)持久:false,自动删除:true,独占:true。如果代理停止并在连接工厂处于活动状态时重新启动,则将重新声明此消息,但所有消息都将丢失。2018-05-22 17:10:50.617错误9---[0.X.X.78:5671]o.s.a.r.c.CachingConnectionFactory:通道关闭:通道错误;协议方法:
#方法(回复代码=405,回复文本=RESOURCE_LOCKED-无法以独占方式访问vhost'/'中锁定的队列'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA',类id=50,方法id=10)2018-05-22 17:10:50.619警告9---[NiW8BAjOWTiVA-2]o.s.amqp.rabbit.core.RabbitAdmin:未能声明队列:队列[name=springCloudBus.anonymous.ev7zcvllslsniw8bajowtiva,持久=false,autoDelete=true,exclusive=true,arguments={}],继续…com.rabbitmq.client.ShutdownSignalException:通道错误;协议方法:#method(回复代码=405,回复文本=RESOURCE_LOCKED-无法以独占方式访问vhost'/'中锁定的队列'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA',类id=50,方法id=10)2018-05-22 17:10:50.621错误9---[0.X.X.78:5671]o.s.a.r.c.CachingConnectionFactory:通道关闭:通道错误;协议方法:
#方法(回复代码=405,回复文本=RESOURCE_LOCKED-无法以独占方式访问vhost'/'中锁定的队列'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA',类id=50,方法id=20)2018-05-22 17:10:50.623警告9---[NiW8BAjOWTiVA-2]o.s.amqp.rabbit.core.RabbitAdmin:未能声明绑定:绑定[destination=springCloudBus.anonymous.ev7zcvllslsniw8bajowtiva,exchange=springCloudBus,routingKey=#],继续…com.rabbitmq.client.ShutdownSignalException:通道错误;协议方法:#方法(回复代码=405,回复文本=RESOURCE_LOCKED-无法以独占方式访问vhost'/'中的锁定队列'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA',类id=50,方法id=20)2018-05-22 17:10:50.629错误9---[0.X.X.78:5671]o.s.a.r.c.CachingConnectionFactory:通道关闭:通道错误;协议方法:
#方法(回复代码=405,回复文本=RESOURCE_LOCKED-无法以独占方式访问vhost'/'中锁定的队列'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA',类id=50,方法id=10)2018-05-22 17:10:50.630警告9---[NiW8BAjOWTiVA-2]o.s.a.r.listener.BlockingQueueConsumer:未能声明队列:springCloudBus.anonymous.EV7ZCVLslsniw8bajowtiva 2018-05-22 17:10:50.631警告9---[NiW8BAjOWTiVA-2]o.s.a.r.listener.BlockingQueueConsumer:队列声明失败;重试次数=3
org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException:未能在org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:672)上声明队列:[springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA]位于org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:571),位于org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1424),位于java.lang.Thread.java:745原因:java.io.IOException:null位于com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:105)处com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:101)处com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:123)处com.rabbitmq.client.impl.channel.ChannelN.queueDeclarePassive(channel:992)sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)的sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.invoke)(NativeMethodAccessorImpl.java:62)的sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在org.springframework.amqp.rabbit.connection.CachingConnectionFactory$C的java.lang.reflect.Method.invoke(Method.java:498)中
**Versions**
RabbitMQ 3.6.14. (using docker image rabbitmq:3.6.14-management-alpine)
Java 1.8
spring-cloud-starter-bus-amqp => 1.3.1.RELEASE
Spring boot parent => 1.5.9.RELEASE
2018-05-22 17:10:49.647 ERROR 9 --- [.X.X.228:5671] c.r.c.impl.ForgivingExceptionHandler : An unexpected connection driver error occured
com.rabbitmq.client.MissedHeartbeatException: Heartbeat missing with heartbeat = 10 seconds at com.rabbitmq.client.impl.AMQConnection.handleSocketTimeout(AMQConnection.java:723) at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:642) at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:47) at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:572) at java.lang.Thread.run(Thread.java:745)
2018-05-22 17:10:49.652 ERROR 9 --- [.X.X.228:5671] o.s.a.r.c.CachingConnectionFactory : Channel shutdown: connection error 2018-05-22 17:10:49.652 ERROR 9 --- [.X.X.228:5671] o.s.a.r.c.CachingConnectionFactory : Channel shutdown: connection error 2018-05-22 17:10:50.581 INFO 9 --- [NiW8BAjOWTiVA-1] o.s.a.r.l.SimpleMessageListenerContainer : Restarting Consumer@574b7f4a: tags=[{amq.ctag-m35NYazOB0vmhjJHwayDMg=springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA}], channel=Cached Rabbit Channel: AMQChannel(amqp://admin@10.X.X.228:5671/,1), conn: Proxy@76ad6715 Shared Rabbit Connection: SimpleConnection@5a1c3cb4 [delegate=amqp://admin@10.X.X.228:5671/, localPort= 43472], acknowledgeMode=AUTO local queue size=0 2018-05-22 17:10:50.609 INFO 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.c.CachingConnectionFactory : Created new connection: rabbitConnectionFactory#934b52f:1/SimpleConnection@3cd111c6 [delegate=amqp://admin@10.X.X.78:5671/, localPort= 50792] 2018-05-22 17:10:50.613 INFO 9 --- [NiW8BAjOWTiVA-2] o.s.amqp.rabbit.core.RabbitAdmin : Auto-declaring a non-durable, auto-delete, or exclusive Queue (springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA) durable:false, auto-delete:true, exclusive:true. It will be redeclared if the broker stops and is restarted while the connection factory is alive, but all messages will be lost. 2018-05-22 17:10:50.617 ERROR 9 --- [0.X.X.78:5671] o.s.a.r.c.CachingConnectionFactory : Channel shutdown: channel error; protocol method:
#method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) 2018-05-22 17:10:50.619 WARN 9 --- [NiW8BAjOWTiVA-2] o.s.amqp.rabbit.core.RabbitAdmin : Failed to declare queue: Queue [name=springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA, durable=false, autoDelete=true, exclusive=true, arguments={}], continuing... com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) 2018-05-22 17:10:50.621 ERROR 9 --- [0.X.X.78:5671] o.s.a.r.c.CachingConnectionFactory : Channel shutdown: channel error; protocol method:
#method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=20) 2018-05-22 17:10:50.623 WARN 9 --- [NiW8BAjOWTiVA-2] o.s.amqp.rabbit.core.RabbitAdmin : Failed to declare binding: Binding [destination=springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA, exchange=springCloudBus, routingKey=#], continuing... com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=20) 2018-05-22 17:10:50.629 ERROR 9 --- [0.X.X.78:5671] o.s.a.r.c.CachingConnectionFactory : Channel shutdown: channel error; protocol method:
#method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) 2018-05-22 17:10:50.630 WARN 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.listener.BlockingQueueConsumer : Failed to declare queue: springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA 2018-05-22 17:10:50.631 WARN 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.listener.BlockingQueueConsumer : Queue declaration failed; retries left=3
org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA] at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:672) at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:571) at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1424) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: null at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:105) at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:101) at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:123) at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:992) at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:980) at com.sun.proxy.$Proxy155.queueDeclarePassive(Unknown Source) at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:651) ... 3 common frames omitted Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:32) at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366) at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:229) at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:117) ... 12 common frames omitted Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:505) at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:336) at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:143) at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:90) at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:634) at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:47) at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:572) ... 1 common frames omitted
2018-05-22 17:10:55.635 WARN 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.listener.BlockingQueueConsumer : Failed to declare queue: springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA 2018-05-22 17:10:55.636 WARN 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.listener.BlockingQueueConsumer : Queue declaration failed; retries left=2
org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA] at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:672) at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:571) at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1424) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: null at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:105) at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:101) at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:123) at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:992) at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:980) at com.sun.proxy.$Proxy155.queueDeclarePassive(Unknown Source) at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:651) ... 3 common frames omitted Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:32) at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366) at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:229) at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:117) ... 12 common frames omitted Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:505) at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:336) at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:143) at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:90) at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:634) at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:47) at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:572) ... 1 common frames omitted
2018-05-22 17:11:00.656 WARN 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.listener.BlockingQueueConsumer : Failed to declare queue: springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA 2018-05-22 17:11:00.657 WARN 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.listener.BlockingQueueConsumer : Queue declaration failed; retries left=1
org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA] at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:672) at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:571) at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1424) at java.lang.Thread.run(Thread.java:745) Caused by: java.io.IOException: null at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:105) at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:101) at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:123) at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:992) at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:980) at com.sun.proxy.$Proxy155.queueDeclarePassive(Unknown Source) at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:651) ... 3 common frames omitted Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:32) at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366) at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:229) at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:117) ... 12 common frames omitted Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:505) at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:336) at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:143) at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:90) at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:634) at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:47) at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:572) ... 1 common frames omitted
2018-05-22 17:11:05.662 WARN 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.listener.BlockingQueueConsumer : Failed to declare queue: springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA 2018-05-22 17:11:05.664 ERROR 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.l.SimpleMessageListenerContainer : Consumer received fatal=false exception on startup
org.springframework.amqp.rabbit.listener.QueuesNotAvailableException: Cannot prepare queue for listener. Either the queue doesn't exist or the broker will not allow us to use it. at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:599) at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1424) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA] at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:672) at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:571) ... 2 common frames omitted Caused by: java.io.IOException: null at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:105) at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:101) at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:123) at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:992) at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:980) at com.sun.proxy.$Proxy155.queueDeclarePassive(Unknown Source) at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:651) ... 3 common frames omitted Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:32) at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366) at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:229) at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:117) ... 12 common frames omitted Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:505) at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:336) at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:143) at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:90) at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:634) at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:47) at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:572) ... 1 common frames omitted
2018-05-22 17:11:05.664 ERROR 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.l.SimpleMessageListenerContainer : Consumer received fatal exception on startup
org.springframework.amqp.rabbit.listener.QueuesNotAvailableException: Cannot prepare queue for listener. Either the queue doesn't exist or the broker will not allow us to use it. at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:599) at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1424) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA] at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:672) at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:571) ... 2 common frames omitted Caused by: java.io.IOException: null at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:105) at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:101) at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:123) at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:992) at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:980) at com.sun.proxy.$Proxy155.queueDeclarePassive(Unknown Source) at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:651) ... 3 common frames omitted Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:32) at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366) at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:229) at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:117) ... 12 common frames omitted Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'springCloudBus.anonymous.eV7zCVLlSNiW8BAjOWTiVA' in vhost '/', class-id=50, method-id=10) at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:505) at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:336) at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:143) at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:90) at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:634) at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:47) at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:572) ... 1 common frames omitted
2018-05-22 17:11:05.666 ERROR 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.l.SimpleMessageListenerContainer : Stopping container from aborted consumer 2018-05-22 17:11:05.666 INFO 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.l.SimpleMessageListenerContainer : Waiting for workers to finish. 2018-05-22 17:11:05.666 INFO 9 --- [NiW8BAjOWTiVA-2] o.s.a.r.l.SimpleMessageListenerContainer : Successfully waited for workers to finish.
@Bean
public static Object addDelayOnReconnect(CachingConnectionFactory connectionFactory) {
connectionFactory.addConnectionListener(new ConnectionListener() {
private final AtomicBoolean initialConnection = new AtomicBoolean(true);
@Override
public void onCreate(Connection connection) {
if (!this.initialConnection.compareAndSet(true, false)) {
try {
System.out.println("Waiting a while for auto-delete queues to be deleted...");
Thread.sleep(5_000);
System.out.println("Continuing...");
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
}
}
@Override
public void onClose(Connection connection) {
// empty
}
});
return new Object();
}
2018-05-22 17:16:45.599 ... : Created new connection: rabbitConnectionFactory#787e4357:1/SimpleConnection@37c0e81b [delegate=amqp://guest@127.0.0.1:5672/, localPort= 50201]
Waiting a while for auto-delete queues to be deleted...
Continuing...
2018-05-22 17:16:50.605 ... : Auto-declaring a non-durable, auto-delete, or exclusive Queue (springCloudBus.anonymous.RQp18TX0SpObVqJSEr64hQ) durable:false, auto-delete:true, exclusive:true. It will be redeclared if the broker stops and is restarted while the connection factory is alive, but all messages will be lost.
@Bean
public AmqpAdmin amqpAdmin(ConnectionFactory connectionFactory) {
return new RabbitAdmin(connectionFactory) {
@Override
public void initialize() {
while (true) { // might want to give up after some number of tries
try {
super.initialize();
break;
}
catch (Exception e) {
System.out.println("Failed to declare elements: " + e.getCause().getCause().getMessage());
try {
Thread.sleep(1_000);
}
catch (InterruptedException e1) {
Thread.currentThread().interrupt();
}
}
}
}
};
}