Restore a faulty subscription
1van3 opened this issue · 1 comments
1van3 commented
Hello,
a few days ago a colleague of mine has encountered a strange behavior - sometime channel subscription "hangs".
I have tried to investigate an issue and here is my observations:
- Subscription "hangs" because default channel Rpc timeout is 10 minutes (see com.rabbitmq.client.ConnectionFactory.DEFAULT_CHANNEL_RPC_TIMEOUT) and there was no ACK on DeclareQueue method from Rabbit side sometimes.
- After i have changed DEFAULT_CHANNEL_RPC_TIMEOUT to 1 second (btw there is no way to do it in current version of op-rabbit (see com.spingo.op_rabbit.ConnectionParams)) i was expecting that faulty subscription will recover automatically, but got unhandled TimeoutException (probably for the same reason - because Rabbit hasn't ACKed Close message)
java.util.concurrent.TimeoutException
at com.rabbitmq.utility.BlockingCell.get(BlockingCell.java:77)
at com.rabbitmq.utility.BlockingCell.uninterruptibleGet(BlockingCell.java:120)
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:494)
at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:604)
at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:529)
at com.rabbitmq.client.impl.ChannelN.close(ChannelN.java:522)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.newmotion.akka.rabbitmq.RabbitMqActor$class.closeIfOpen(RabbitMqActor.scala:27)
at com.newmotion.akka.rabbitmq.ChannelActor.closeIfOpen(ChannelActor.scala:29)
Guys, can you suggest, what should i do in such case?
Should i try to kill subscription/rabbit control or restore should be performed on op-rabbit side?
If it should be done on my side please suggest how to correctly stop subscription.
timcharper commented
Did you try calling subscriptionRef.abort?