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

Can someone help provide how to do proper shutdown in demo? #196

Open
kkalavantavanich opened this issue Sep 15, 2020 · 3 comments
Open

Comments

@kkalavantavanich
Copy link

I'm trying to figure out how to do a proper shutdown. The SubscriptionRef.close() and SubscriptionRef.await() weren't doing their jobs for me. It would be great if the demo can show a proper shutdown.

@chameleon82
Copy link

@timcharper @aaabramov @pjfanning
also interested in best practice, could you guys help?

@pjfanning
Copy link
Contributor

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)

@aaabramov
Copy link
Contributor

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

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

No branches or pull requests

4 participants