Closed borice closed 6 years ago
I've managed to make a working version. It involves using the ask pattern and waiting for the resulting future completion, then invoking actorSystem.terminate()
combined with Await.ready(actorSystem.whenTerminated, ...
Hello.
I'm trying to use op-rabbit in a small Scala app that needs to publish a single message to an exchange, then exit. I'm able to get the message published, but not sure how to properly cause the app to exit.
I tried to
actorSystem.registerOnTermination { System.exit(0) }
and usedrabbitControl ! PoisonPill
after therabbitControl ! Message.topic(...)
but the app doesn't exit.What's the proper way to send a single message, then exit the app (ideally after it's confirmed that the message was successfully delivered to the exchange)?
Thank you!