Open kkalavantavanich opened 3 years ago
@timcharper @aaabramov @pjfanning also interested in best practice, could you guys help?
Not sure if this helps but I used op-rabbit in the previous company I worked for and the code was deployed in Play servers - so we injected the play.api.inject.ApplicationLifecycle instance and added a stop hook to the ApplicationLifecycle to close the subscribers.
An alternative is https://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread)
@timcharper @aaabramov @pjfanning also interested in best practice, could you guys help?
Same as per @pjfanning's answer. Either use Akka's ActorSystem lifecycle or Play's ApplicationLifecycle.
I'm trying to figure out how to do a proper shutdown. The
SubscriptionRef.close()
andSubscriptionRef.await()
weren't doing their jobs for me. It would be great if the demo can show a proper shutdown.