Open durre opened 9 years ago
Good catch. Thanks for reporting. I'm working on it.
Same exception here +1 One possible solution may be to put shutdown listener and try to reconnect
@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.
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.
+1
+1
I've made it work, check: #49
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
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".