How to gracefully shutdown vertx from eventbus

58 views
Skip to first unread message

Idan Fridman

unread,
Aug 21, 2017, 9:07:38 AM8/21/17
to vert.x
Our cluster consumes events via eventbus and caching some of them in-memory.

We do have redeployments which requires restarts. before we remove node member from the cluster we would like to give it a grace time till all current messages will finish to process before shutting it down.

How can we programmatically force-stop an eventbus listener and avoid it to consume messages?

Thanks
 

Clement Escoffier

unread,
Aug 21, 2017, 9:33:24 AM8/21/17
to ve...@googlegroups.com
Hi,

You can call unregister on the MessageConsumer returned by the “consumer” methods. (http://vertx.io/docs/apidocs/io/vertx/core/eventbus/MessageConsumer.html)

Clement



--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/vertx.
To view this discussion on the web, visit https://groups.google.com/d/msgid/vertx/900b1bbf-e67e-4be8-af32-ece06d0f4a2b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Idan Fridman

unread,
Aug 22, 2017, 3:15:44 AM8/22/17
to ve...@googlegroups.com
Thanks for that.
I can create an http endpoint which our infra can trigger before shutting down vertx instance.

 but now we need to make a list of all the endpoints of each service's consumer and unsubscribe them. 

Can you think about a way how we can avoid that mapping list and just "tell" a service to unsubscribe from all the eventbus topics that it has subscribed?

Thanks.


You received this message because you are subscribed to a topic in the Google Groups "vert.x" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vertx/VCPKW9aqaLg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vertx+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages