reactive-rabbit icon indicating copy to clipboard operation
reactive-rabbit copied to clipboard

No automatic recovery

Open durre opened this issue 10 years ago • 8 comments

I gave this template a try: http://typesafe.com/activator/template/rabbitmq-akka-stream

I start the app with activator run, then kill the rabbitmq server and start it back up again. Nothing happened even though I have the setting recovery-interval = 5s. Am I missing something?

I tried debugging it and saw that you never set factory.setAutomaticRecoveryEnabled(true). Doing that helps, but there are still issues with "com.rabbitmq.client.AlreadyClosedException: channel is already closed due to clean channel shutdown".

durre avatar Jan 02 '15 23:01 durre

Good catch. Thanks for reporting. I'm working on it.

mkiedys avatar Jan 07 '15 12:01 mkiedys

Same exception here +1 One possible solution may be to put shutdown listener and try to reconnect

iozozturk avatar Jul 08 '15 23:07 iozozturk

@iozozturk wrote:

is this project dead or in a deep sleep?

No, is not. You can always help if you feel that some feature is missing.

Same exception here +1 One possible solution may be to put shutdown listener and try to reconnect

Configuration option for automatic recovery has been added here: a9c0540 Subscription will continue to fail on network failures anyway. If imagine we could use com.rabbitmq.client.Recoverable to reover subscriptions too.

mkiedys avatar Jul 16 '15 22:07 mkiedys

I've posted https://github.com/ScalaConsultants/reactive-rabbit/pull/36 what is first step toward fixing this, but is rather independent of further change that has to be done. Namely I think that QueueSubscription should not signal subscriber.onError if automatic recovery is set. IMO it should signal error only if connection is gone when it tried to operate on channel. Imagine that there is no demand during time when connection is broken.

LGLO avatar Feb 03 '16 06:02 LGLO

+1

vitorsvieira avatar May 31 '16 15:05 vitorsvieira

+1

RodrigoLimasss avatar Jun 10 '16 15:06 RodrigoLimasss

I've made it work, check: #49

pribor avatar Jul 14 '16 09:07 pribor

One gotcha here is that the underlying amqp Java library will not try to recover the initial connection attempt[1]:

If initial client connection to a RabbitMQ node fails, automatic connection recovery won't kick in. Applications developers are responsible for retrying such connections, logging failed attempts, implementing a limit to the number of retries and so on.

[1] https://www.rabbitmq.com/api-guide.html#connection-recovery-triggers

dskrvk avatar Jun 18 '18 21:06 dskrvk