Hello everyone,
now and then, the connection between clients and our RabbitMQ server may reset. I noticed that in this case, we get a very large number of the same exception in our Java client:
2018-02-15 00:49:36,603 [WARN] com.rabbitmq.client.impl.ForgivingExceptionHandler - An unexpected connection driver error occured (Exception message: Connection reset)
2018-02-15 00:49:41,636 [ERROR] com.rabbitmq.client.impl.ForgivingExceptionHandler - Caught an exception when recovering topology Caught an exception while recovering queue workloads: channel is already closed due to clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)
com.rabbitmq.client.TopologyRecoveryException: Caught an exception while recovering queue workloads: channel is already closed due to clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.recoverQueues(AutorecoveringConnection.java:632)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.recoverEntities(AutorecoveringConnection.java:583)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.beginAutomaticRecovery(AutorecoveringConnection.java:506)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.access$000(AutorecoveringConnection.java:53)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection$1.recoveryCanBegin(AutorecoveringConnection.java:435)
at com.rabbitmq.client.impl.AMQConnection.notifyRecoveryCanBeginListeners(AMQConnection.java:700)
at com.rabbitmq.client.impl.AMQConnection.doFinalShutdown(AMQConnection.java:694)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:584)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.rabbitmq.client.AlreadyClosedException: channel is already closed due to clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)
at com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(AMQChannel.java:209)
at com.rabbitmq.client.impl.AMQChannel.rpc(AMQChannel.java:270)
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:233)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:128)
at com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:948)
at com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:50)
at com.rabbitmq.client.impl.recovery.RecordedQueue.recover(RecordedQueue.java:53)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.recoverQueues(AutorecoveringConnection.java:608)
... 8 common frames omitted
<200 instances of the same exception>
2018-02-15 00:49:41,767 [ERROR] com.rabbitmq.client.impl.ForgivingExceptionHandler - Caught an exception when recovering topology Caught an exception while recovering queue result.389: channel is already closed due to clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)
com.rabbitmq.client.TopologyRecoveryException: Caught an exception while recovering queue result.389: channel is already closed due to clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.recoverQueues(AutorecoveringConnection.java:632)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.recoverEntities(AutorecoveringConnection.java:583)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.beginAutomaticRecovery(AutorecoveringConnection.java:506)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.access$000(AutorecoveringConnection.java:53)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection$1.recoveryCanBegin(AutorecoveringConnection.java:435)
at com.rabbitmq.client.impl.AMQConnection.notifyRecoveryCanBeginListeners(AMQConnection.java:700)
at com.rabbitmq.client.impl.AMQConnection.doFinalShutdown(AMQConnection.java:694)
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:584)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.rabbitmq.client.AlreadyClosedException: channel is already closed due to clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)
at com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(AMQChannel.java:209)
at com.rabbitmq.client.impl.AMQChannel.rpc(AMQChannel.java:270)
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:233)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:128)
at com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:948)
at com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:50)
at com.rabbitmq.client.impl.recovery.RecordedQueue.recover(RecordedQueue.java:53)
at com.rabbitmq.client.impl.recovery.AutorecoveringConnection.recoverQueues(AutorecoveringConnection.java:608)
... 8 common frames omitted
We first get a warning, then 5 seconds later, the same exception is thrown over and over again, until after ~100ms when, I assume, the connection could be re-established (or at least the exceptions do not get thrown anymore). It's great that RabbitMQ attempts to perform auto-recovery but I think something is wrong with our setup because of the repeated exceptions.
Would be thankful for any tips or advice.
-- Christoph