ScalaConsultants / reactive-rabbit

Reactive Streams driver for AMQP protocol. Powered by RabbitMQ library.
Apache License 2.0
184 stars 40 forks source link

Publisher handling server failure #45

Closed pocman closed 8 years ago

pocman commented 8 years ago

Hi, how can I make a QueuePublisher resilient to server failure ? I'm creating a Stream using Source.fromPublisher(connection.consume(queue = queue)) and I would like to make this source resilient to rabbitMQ (server side) failure. I tried using

  val resumingLogging: Supervision.Decider = {
    case sig: ShutdownSignalException =>
      Logger.warn(s"${sig.getCause}\n${sig.getMessage}\n${sig.getStackTrace.mkString("\n")}")
      Supervision.Restart

But it doesn't do the trick.

pocman commented 8 years ago

Adding more configuration did the trick.

  automatic-recovery = true

  recovery-interval = 2s
mkiedys commented 8 years ago

👍