Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No automatic recovery #10

Open
durre opened this issue Jan 2, 2015 · 8 comments
Open

No automatic recovery #10

durre opened this issue Jan 2, 2015 · 8 comments

Comments

@durre
Copy link

durre commented Jan 2, 2015

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".

@mkiedys
Copy link
Contributor

mkiedys commented Jan 7, 2015

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

@mkiedys mkiedys added the bug label Jan 7, 2015
@iozozturk
Copy link

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

@mkiedys
Copy link
Contributor

mkiedys commented Jul 16, 2015

@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.

@LGLO
Copy link
Contributor

LGLO commented Feb 3, 2016

I've posted #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.

@vitorsvieira
Copy link

+1

1 similar comment
@RodrigoLimasss
Copy link

+1

@pribor
Copy link

pribor commented Jul 14, 2016

I've made it work, check: #49

@dskrvk
Copy link

dskrvk commented Jun 18, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants