{"action":"created","issue":{"url":"https://api.github.com/repos/SpinGo/op-rabbit/issues/72","repository_url":"https://api.github.com/repos/SpinGo/op-rabbit","labels_url":"https://api.github.com/repos/SpinGo/op-rabbit/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/SpinGo/op-rabbit/issues/72/comments","events_url":"https://api.github.com/repos/SpinGo/op-rabbit/issues/72/events","html_url":"https://github.com/SpinGo/op-rabbit/issues/72","id":140672425,"number":72,"title":"Consumer does not attempt to reconnect after RabbitMQ was unreachable for short duration.","user":{"login":"jschaul","id":2112744,"avatar_url":"https://avatars.githubusercontent.com/u/2112744?v=3","gravatar_id":"","url":"https://api.github.com/users/jschaul","html_url":"https://github.com/jschaul","followers_url":"https://api.github.com/users/jschaul/followers","following_url":"https://api.github.com/users/jschaul/following{/other_user}","gists_url":"https://api.github.com/users/jschaul/gists{/gist_id}","starred_url":"https://api.github.com/users/jschaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jschaul/subscriptions","organizations_url":"https://api.github.com/users/jschaul/orgs","repos_url":"https://api.github.com/users/jschaul/repos","events_url":"https://api.github.com/users/jschaul/events{/privacy}","received_events_url":"https://api.github.com/users/jschaul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-03-14T13:24:56Z","updated_at":"2016-09-08T08:33:32Z","closed_at":null,"body":"Either op-rabbit or the underlying libraries seem to cause an unrecoverable crash for op-rabbit based consumers after the rabbitmq instance is unavailable (e.g. crashed itself) for a short period of time. Once the actual RabbitMQ is back up, the expected reconnect does not happen for the consumers. Instead the following errors occurred (see stack traces below)\r\n\r\nThis happened with version 1.2.1 of op-rabbit. \r\n\r\nIs there a way to handle this and try to reconnect?\r\n\r\nlogger name: `akka.actor.OneForOneStrategy`\r\nfull stacktrace:\r\n```\r\njava.io.IOException: null\r\n    at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n    at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n    at com.rabbitmq.client.impl.ChannelN.basicConsume(ChannelN.java:1092) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n    at com.rabbitmq.client.impl.ChannelN.basicConsume(ChannelN.java:1052) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n    at com.spingo.op_rabbit.impl.AsyncAckingRabbitConsumer.setupSubscription(AsyncAckingRabbitConsumer.scala:97) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n    at com.spingo.op_rabbit.impl.AsyncAckingRabbitConsumer$$anonfun$connected$1.applyOrElse(AsyncAckingRabbitConsumer.scala:47) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n    at akka.actor.Actor$class.aroundReceive(Actor.scala:480) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n    at com.spingo.op_rabbit.impl.AsyncAckingRabbitConsumer.aroundReceive(AsyncAckingRabbitConsumer.scala:11) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526) [com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n    at akka.actor.ActorCell.invoke(ActorCell.scala:495) [com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257) [com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n    at akka.dispatch.Mailbox.run(Mailbox.scala:224) [com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n    at akka.dispatch.Mailbox.exec(Mailbox.scala:234) [com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [org.scala-lang.scala-library-2.11.7.jar:na]\r\n    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [org.scala-lang.scala-library-2.11.7.jar:na]\r\n    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [org.scala-lang.scala-library-2.11.7.jar:na]\r\n    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [org.scala-lang.scala-library-2.11.7.jar:na]#012Caused by: com.rabbitmq.client.ShutdownSignalException: clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)\r\n    at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n    at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n    at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:348) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n    at com.rabbitmq.client.impl.ChannelN.basicConsume(ChannelN.java:1090) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n... 14 common frames omitted\r\nCaused by: com.rabbitmq.client.ShutdownSignalException: clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)\r\n    at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:548) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n    at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:503) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n    at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:497) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]\r\n    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]\r\n    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]\r\n    at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]\r\n    at com.thenewmotion.akka.rabbitmq.RabbitMqActor$class.closeIfOpen(RabbitMqActor.scala:27) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n    at com.thenewmotion.akka.rabbitmq.ChannelActor.closeIfOpen(ChannelActor.scala:34) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n    at com.thenewmotion.akka.rabbitmq.ChannelActor$$anonfun$2.applyOrElse(ChannelActor.scala:115) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n    at com.thenewmotion.akka.rabbitmq.ChannelActor$$anonfun$2.applyOrElse(ChannelActor.scala:112) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n    at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36) ~[org.scala-lang.scala-library-2.11.7.jar:na]\r\n    at akka.actor.FSM$class.processEvent(FSM.scala:654) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n    at com.thenewmotion.akka.rabbitmq.ChannelActor.processEvent(ChannelActor.scala:34) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n    at akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:648) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n    at akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:642) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n    at akka.actor.Actor$class.aroundReceive(Actor.scala:480) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n    at com.thenewmotion.akka.rabbitmq.ChannelActor.aroundReceive(ChannelActor.scala:34) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n... 9 common frames omitted\r\n```\r\n\r\nfollowed by a \r\nlogger name: `com.spingo.op_rabbit.SubscriptionActor`\r\nmessage: `An error while trying to bind a consumer to <queue-name>`\r\nfull stacktrace:\r\n```\r\njava.io.IOException: null\r\n  at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:124) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.rabbitmq.client.impl.ChannelN.queueBind(ChannelN.java:921) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.rabbitmq.client.impl.ChannelN.queueBind(ChannelN.java:936) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.rabbitmq.client.impl.ChannelN.queueBind(ChannelN.java:61) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.spingo.op_rabbit.Binding$$anon$2$$anonfun$declare$2.apply(Binding.scala:71) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n  at com.spingo.op_rabbit.Binding$$anon$2$$anonfun$declare$2.apply(Binding.scala:71) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n  at scala.collection.immutable.List.foreach(List.scala:381) ~[org.scala-lang.scala-library-2.11.7.jar:na]\r\n  at com.spingo.op_rabbit.Binding$$anon$2.declare(Binding.scala:71) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n  at com.spingo.op_rabbit.SubscriptionActor.doSubscribe(SubscriptionActor.scala:232) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n  at com.spingo.op_rabbit.SubscriptionActor$$anonfun$8.applyOrElse(SubscriptionActor.scala:159) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n  at com.spingo.op_rabbit.SubscriptionActor$$anonfun$8.applyOrElse(SubscriptionActor.scala:146) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n  at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36) ~[org.scala-lang.scala-library-2.11.7.jar:na]\r\n  at akka.actor.FSM$$anonfun$handleTransition$1.apply(FSM.scala:597) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at akka.actor.FSM$$anonfun$handleTransition$1.apply(FSM.scala:597) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at scala.collection.immutable.List.foreach(List.scala:381) ~[org.scala-lang.scala-library-2.11.7.jar:na]\r\n  at akka.actor.FSM$class.handleTransition(FSM.scala:597) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at akka.actor.FSM$class.makeTransition(FSM.scala:679) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at com.spingo.op_rabbit.SubscriptionActor.makeTransition(SubscriptionActor.scala:13) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n  at akka.actor.FSM$class.applyState(FSM.scala:664) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at com.spingo.op_rabbit.SubscriptionActor.applyState(SubscriptionActor.scala:13) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n  at akka.actor.FSM$class.processEvent(FSM.scala:659) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at com.spingo.op_rabbit.SubscriptionActor.akka$actor$LoggingFSM$$super$processEvent(SubscriptionActor.scala:13) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n  at akka.actor.LoggingFSM$class.processEvent(FSM.scala:790) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at com.spingo.op_rabbit.SubscriptionActor.processEvent(SubscriptionActor.scala:13) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n  at akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:648) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:642) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at akka.actor.Actor$class.aroundReceive(Actor.scala:480) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at com.spingo.op_rabbit.SubscriptionActor.aroundReceive(SubscriptionActor.scala:13) ~[com.spingo.op-rabbit-core_2.11-1.2.1.jar:1.2.1]\r\n  at akka.actor.ActorCell.receiveMessage(ActorCell.scala:526) [com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at akka.actor.ActorCell.invoke(ActorCell.scala:495) [com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257) [com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at akka.dispatch.Mailbox.run(Mailbox.scala:224) [com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at akka.dispatch.Mailbox.exec(Mailbox.scala:234) [com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [org.scala-lang.scala-library-2.11.7.jar:na]\r\n  at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [org.scala-lang.scala-library-2.11.7.jar:na]\r\n  at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [org.scala-lang.scala-library-2.11.7.jar:na]\r\n  at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [org.scala-lang.scala-library-2.11.7.jar:na]\r\nCaused by: com.rabbitmq.client.ShutdownSignalException: clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)\r\n  at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:348) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:221) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:118) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n... 36 common frames omitted\r\nCaused by: com.rabbitmq.client.ShutdownSignalException: clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)\r\n  at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:548) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:503) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:497) ~[com.rabbitmq.amqp-client-3.5.2.jar:na]\r\n  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]\r\n  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]\r\n  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]\r\n  at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]\r\n  at com.thenewmotion.akka.rabbitmq.RabbitMqActor$class.closeIfOpen(RabbitMqActor.scala:27) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n  at com.thenewmotion.akka.rabbitmq.ChannelActor.closeIfOpen(ChannelActor.scala:34) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n  at com.thenewmotion.akka.rabbitmq.ChannelActor$$anonfun$2.applyOrElse(ChannelActor.scala:115) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n  at com.thenewmotion.akka.rabbitmq.ChannelActor$$anonfun$2.applyOrElse(ChannelActor.scala:112) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n  at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36) ~[org.scala-lang.scala-library-2.11.7.jar:na]\r\n  at akka.actor.FSM$class.processEvent(FSM.scala:654) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at com.thenewmotion.akka.rabbitmq.ChannelActor.processEvent(ChannelActor.scala:34) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n  at akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:648) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:642) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at akka.actor.Actor$class.aroundReceive(Actor.scala:480) ~[com.typesafe.akka.akka-actor_2.11-2.4.1.jar:na]\r\n  at com.thenewmotion.akka.rabbitmq.ChannelActor.aroundReceive(ChannelActor.scala:34) ~[com.thenewmotion.akka.akka-rabbitmq_2.11-2.2.jar:2.2]\r\n... 9 common frames omitted\r\n```"},"comment":{"url":"https://api.github.com/repos/SpinGo/op-rabbit/issues/comments/245530033","html_url":"https://github.com/SpinGo/op-rabbit/issues/72#issuecomment-245530033","issue_url":"https://api.github.com/repos/SpinGo/op-rabbit/issues/72","id":245530033,"user":{"login":"jschaul","id":2112744,"avatar_url":"https://avatars.githubusercontent.com/u/2112744?v=3","gravatar_id":"","url":"https://api.github.com/users/jschaul","html_url":"https://github.com/jschaul","followers_url":"https://api.github.com/users/jschaul/followers","following_url":"https://api.github.com/users/jschaul/following{/other_user}","gists_url":"https://api.github.com/users/jschaul/gists{/gist_id}","starred_url":"https://api.github.com/users/jschaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jschaul/subscriptions","organizations_url":"https://api.github.com/users/jschaul/orgs","repos_url":"https://api.github.com/users/jschaul/repos","events_url":"https://api.github.com/users/jschaul/events{/privacy}","received_events_url":"https://api.github.com/users/jschaul/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T08:33:31Z","updated_at":"2016-09-08T08:33:31Z","body":"TL;DR: If you have this, or similar problem with disconnects, use \r\n```scala\r\nconsume(Queue.passive(topic(queue(\"wow-maybe-queue\"), List(\"some-topic.#\"))))\r\n```\r\n\r\nFull explanation:\r\n\r\nIn case anyone faces similar issues (they still occur with op-rabbit 1.3.0), in a race-condition way (sometimes occurs, sometimes not), some explanations:\r\n\r\nThe exact problem is that after a disconnect to rabbitmq (forced from rabbitmq side by e.g. closing the connection via the rabbitmq web interface), op-rabbit successfully reconnects to rabbitmq, but fails to bind a queue.\r\n\r\nStart a consumer (all as supposed to be):\r\n```\r\n[info] INFO  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/confirmed-publisher-channel connected\r\n[info] INFO  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/publisher connected\r\n[info] INFO  c.t.akka.rabbitmq.ConnectionActor - akka://default/user/$a/connection connected to amqp://vagrant@{<IP>:5672}:5672//\r\n[info] INFO  c.d.d.c.p.DCAwareRoundRobinPolicy - Using data-center name 'datacenter1' for DCAwareRoundRobinPolicy (if this is incorrect, please provide the correct datacenter name with DCAwareRoundRobinPolicy constructor)\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - processing Event(Run,DisconnectedPayload(Paused,10,None)) from Actor[akka://default/user/$a#-246056593]\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - processing Event(ChannelCreated(Actor[akka://default/user/$a/connection/$a#-1186346017]),DisconnectedPayload(Binding,10,None)) from Actor[akka://default/user/$a/connection#1872231705]\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - Channel created; AMQChannel(amqp://vagrant@<IP>:5672/,3)\r\n[info] INFO  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/$a connected\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - processing Event(ChannelConnected(AMQChannel(amqp://vagrant@<IP>:5672/,3),Actor[akka://default/user/$a/connection/$a#-1186346017]),DisconnectedPayload(Binding,10,None)) from Actor[akka://default/user/$a/subscription-my-queue-name-1#1860926862]\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - Setting up subscription to my-queue-name in akka://default/user/$a/subscription-my-queue-name-1\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - transition Disconnected -> Binding\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - processing Event(BindSuccess(AMQChannel(amqp://vagrant@<IP>:5672/,3)),ConnectedPayload(Actor[akka://default/user/$a/connection/$a#-1186346017],AMQChannel(amqp://vagrant@<IP>:5672/,3),10,Some(Actor[akka://default/user/$a/subscription-my-queue-name-1/consumer#-1397250152]),None)) from Actor[akka://default/user/$a/subscription-my-queue-name-1#1860926862]\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - transition Binding -> Running\r\n```\r\n\r\nlet's force a connection close via rabbitmq console (behaviour good as it should be in this case)\r\n```\r\n[info] WARN  c.t.akka.rabbitmq.ConnectionActor - akka://default/user/$a/connection lost connection to amqp://vagrant@{<IP>:5672}:5672//\r\n[info] WARN  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/$a disconnected\r\n[info] WARN  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/confirmed-publisher-channel disconnected\r\n[info] WARN  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/publisher disconnected\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - Channel created; AMQChannel(amqp://vagrant@<IP>:5672/,1)\r\n[info] INFO  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/$a connected\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - processing Event(ChannelConnected(AMQChannel(amqp://vagrant@<IP>:5672/,1),Actor[akka://default/user/$a/connection/$a#-1186346017]),ConnectedPayload(Actor[akka://default/user/$a/connection/$a#-1186346017],AMQChannel(amqp://vagrant@<IP>:5672/,3),10,Some(Actor[akka://default/user/$a/subscription-my-queue-name-1/consumer#-1397250152]),None)) from Actor[akka://default/user/$a/subscription-my-queue-name-1#1860926862]\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - Setting up subscription to my-queue-name in akka://default/user/$a/subscription-my-queue-name-1\r\n[info] INFO  c.t.akka.rabbitmq.ConnectionActor - akka://default/user/$a/connection connected to amqp://vagrant@{<IP>:5672}:5672//\r\n[info] INFO  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/publisher connected\r\n[info] INFO  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/confirmed-publisher-channel connected\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - Channel created; AMQChannel(amqp://vagrant@<IP>:5672/,4)\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - transition Running -> Binding\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - processing Event(ChannelConnected(AMQChannel(amqp://vagrant@<IP>:5672/,4),Actor[akka://default/user/$a/connection/$a#-1186346017]),ConnectedPayload(Actor[akka://default/user/$a/connection/$a#-1186346017],AMQChannel(amqp://vagrant@<IP>:5672/,1),10,Some(Actor[akka://default/user/$a/subscription-my-queue-name-1/consumer#-1397250152]),None)) from Actor[akka://default/user/$a/subscription-my-queue-name-1#1860926862]\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - Setting up subscription to my-queue-name in akka://default/user/$a/subscription-my-queue-name-1\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - processing Event(BindFailure(AMQChannel(amqp://vagrant@<IP>:5672/,1),java.io.IOException),ConnectedPayload(Actor[akka://default/user/$a/connection/$a#-1186346017],AMQChannel(amqp://vagrant@<IP>:5672/,4),10,Some(Actor[akka://default/user/$a/subscription-my-queue-name-1/consumer#-1397250152]),None)) from Actor[akka://default/user/$a/subscription-my-queue-name-1#1860926862]\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - processing Event(BindSuccess(AMQChannel(amqp://vagrant@<IP>:5672/,4)),ConnectedPayload(Actor[akka://default/user/$a/connection/$a#-1186346017],AMQChannel(amqp://vagrant@<IP>:5672/,4),10,Some(Actor[akka://default/user/$a/subscription-my-queue-name-1/consumer#-1397250152]),None)) from Actor[akka://default/user/$a/subscription-my-queue-name-1#1860926862]\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - transition Binding -> Running\r\n```\r\n\r\nrepeat: let's force a connection close via rabbitmq console: this time we see the error. The result is a consumer that is stuck and never recovers.\r\n\r\n```\r\n[info] WARN  c.t.akka.rabbitmq.ConnectionActor - akka://default/user/$a/connection lost connection to amqp://vagrant@{<IP>:5672}:5672//\r\n[info] WARN  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/$a disconnected\r\n[info] WARN  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/publisher disconnected\r\n[info] WARN  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/confirmed-publisher-channel disconnected\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - Channel created; AMQChannel(amqp://vagrant@<IP>:5672/,1)\r\n[info] INFO  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/$a connected\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - processing Event(ChannelConnected(AMQChannel(amqp://vagrant@<IP>:5672/,1),Actor[akka://default/user/$a/connection/$a#-1186346017]),ConnectedPayload(Actor[akka://default/user/$a/connection/$a#-1186346017],AMQChannel(amqp://vagrant@<IP>:5672/,4),10,Some(Actor[akka://default/user/$a/subscription-my-queue-name-1/consumer#-1397250152]),None)) from Actor[akka://default/user/$a/subscription-my-queue-name-1#1860926862]\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - Setting up subscription to my-queue-name in akka://default/user/$a/subscription-my-queue-name-1\r\n[info] INFO  c.t.akka.rabbitmq.ConnectionActor - akka://default/user/$a/connection connected to amqp://vagrant@{<IP>:5672}:5672//\r\n[info] INFO  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/publisher connected\r\n[info] INFO  c.t.akka.rabbitmq.ChannelActor - akka://default/user/$a/connection/confirmed-publisher-channel connected\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - transition Running -> Binding\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - processing Event(BindFailure(AMQChannel(amqp://vagrant@<IP>:5672/,1),java.io.IOException),ConnectedPayload(Actor[akka://default/user/$a/connection/$a#-1186346017],AMQChannel(amqp://vagrant@<IP>:5672/,1),10,Some(Actor[akka://default/user/$a/subscription-my-queue-name-1/consumer#-1397250152]),None)) from Actor[akka://default/user/$a/subscription-my-queue-name-1#1860926862]\r\n[info] ERROR c.s.op_rabbit.SubscriptionActor - An error while trying to bind a consumer to my-queue-name\r\n[info] java.io.IOException: null\r\n[info] \tat com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106)\r\n[info] \tat com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102)\r\n[info] \tat com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:124)\r\n[info] \tat com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:844)\r\n[info] \tat com.rabbitmq.client.impl.ChannelN.queueDeclare(ChannelN.java:61)\r\n[info] \tat com.spingo.op_rabbit.QueueConcrete.declare(Queue.scala:27)\r\n[info] \tat com.spingo.op_rabbit.Binding$$anon$2.declare(Binding.scala:70)\r\n[info] \tat com.spingo.op_rabbit.SubscriptionActor.doSubscribe(SubscriptionActor.scala:232)\r\n[info] \tat com.spingo.op_rabbit.SubscriptionActor$$anonfun$8.applyOrElse(SubscriptionActor.scala:159)\r\n[info] \tat com.spingo.op_rabbit.SubscriptionActor$$anonfun$8.applyOrElse(SubscriptionActor.scala:146)\r\n[info] \tat scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)\r\n[info] \tat akka.actor.FSM$$anonfun$handleTransition$1.apply(FSM.scala:604)\r\n[info] \tat akka.actor.FSM$$anonfun$handleTransition$1.apply(FSM.scala:604)\r\n[info] \tat scala.collection.immutable.List.foreach(List.scala:381)\r\n[info] \tat akka.actor.FSM$class.handleTransition(FSM.scala:604)\r\n[info] \tat akka.actor.FSM$class.makeTransition(FSM.scala:686)\r\n[info] \tat com.spingo.op_rabbit.SubscriptionActor.makeTransition(SubscriptionActor.scala:13)\r\n[info] \tat akka.actor.FSM$class.applyState(FSM.scala:671)\r\n[info] \tat com.spingo.op_rabbit.SubscriptionActor.applyState(SubscriptionActor.scala:13)\r\n[info] \tat akka.actor.FSM$class.processEvent(FSM.scala:666)\r\n[info] \tat com.spingo.op_rabbit.SubscriptionActor.akka$actor$LoggingFSM$$super$processEvent(SubscriptionActor.scala:13)\r\n[info] \tat akka.actor.LoggingFSM$class.processEvent(FSM.scala:797)\r\n[info] \tat com.spingo.op_rabbit.SubscriptionActor.processEvent(SubscriptionActor.scala:13)\r\n[info] \tat akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:655)\r\n[info] \tat akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:649)\r\n[info] \tat akka.actor.Actor$class.aroundReceive(Actor.scala:482)\r\n[info] \tat com.spingo.op_rabbit.SubscriptionActor.aroundReceive(SubscriptionActor.scala:13)\r\n[info] \tat akka.actor.ActorCell.receiveMessage(ActorCell.scala:526)\r\n[info] \tat akka.actor.ActorCell.invoke(ActorCell.scala:495)\r\n[info] \tat akka.dispatch.Mailbox.processMailbox(Mailbox.scala:257)\r\n[info] \tat akka.dispatch.Mailbox.run(Mailbox.scala:224)\r\n[info] \tat akka.dispatch.Mailbox.exec(Mailbox.scala:234)\r\n[info] \tat scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)\r\n[info] \tat scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)\r\n[info] \tat scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)\r\n[info] \tat scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)\r\n[info] Caused by: com.rabbitmq.client.ShutdownSignalException: clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)\r\n[info] \tat com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67)\r\n[info] \tat com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33)\r\n[info] \tat com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:361)\r\n[info] \tat com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:226)\r\n[info] \tat com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:118)\r\n[info] \t... 33 common frames omitted\r\n[info] Caused by: com.rabbitmq.client.ShutdownSignalException: clean channel shutdown; protocol method: #method<channel.close>(reply-code=200, reply-text=OK, class-id=0, method-id=0)\r\n[info] \tat com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:554)\r\n[info] \tat com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:509)\r\n[info] \tat com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:503)\r\n[info] \tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n[info] \tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n[info] \tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n[info] \tat java.lang.reflect.Method.invoke(Method.java:497)\r\n[info] \tat com.thenewmotion.akka.rabbitmq.RabbitMqActor$class.closeIfOpen(RabbitMqActor.scala:27)\r\n[info] \tat com.thenewmotion.akka.rabbitmq.ChannelActor.closeIfOpen(ChannelActor.scala:34)\r\n[info] \tat com.thenewmotion.akka.rabbitmq.ChannelActor$$anonfun$2.applyOrElse(ChannelActor.scala:115)\r\n[info] \tat com.thenewmotion.akka.rabbitmq.ChannelActor$$anonfun$2.applyOrElse(ChannelActor.scala:112)\r\n[info] \tat scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:36)\r\n[info] \tat akka.actor.FSM$class.processEvent(FSM.scala:661)\r\n[info] \tat com.thenewmotion.akka.rabbitmq.ChannelActor.processEvent(ChannelActor.scala:34)\r\n[info] \tat akka.actor.FSM$class.akka$actor$FSM$$processMsg(FSM.scala:655)\r\n[info] \tat akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:649)\r\n[info] \tat akka.actor.Actor$class.aroundReceive(Actor.scala:482)\r\n[info] \tat com.thenewmotion.akka.rabbitmq.ChannelActor.aroundReceive(ChannelActor.scala:34)\r\n[info] \t... 9 common frames omitted\r\n[info] DEBUG c.s.op_rabbit.SubscriptionActor - transition Binding -> Stopped\r\n```\r\n\r\nThe workaround, which does not exhibit that problem, is to use Queue.passive with a queue definition:\r\n\r\n```scala\r\nconsume(Queue.passive(topic(queue(\"wow-maybe-queue\"), List(\"some-topic.#\"))))\r\n```\r\n\r\nPerhaps this could be the default behaviour? "}}
{"actor":{"display_login":"jschaul"}}