curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ricardo Ferreira <ricardojs...@gmail.com>
Subject Find current group leader
Date Sun, 26 Oct 2014 22:04:30 GMT
Hi,

I'm using the Leader Election recipe to manage leadership among some of my
nodes.

However, I need to find out the current leader of these nodes from another
client which is not
part of the same group.

I haven't found anything on the API to do this. So what's done is to
instantiate a new LeaderSelector
and a dummy LeaderSelectorListener that relinquishes leadership as soon as
it gets it (just in case).
>From this LeaderSelector I can find the ID of the group leader. Then I'll
query ServiceDiscovery for
the instance corresponding to this ID.

Is there a simpler (or better) way to this?

Mime
View raw message