Skip to content

Cluster Subscriptions with Topology Changes #1811

Answered by mp911de
jaredpetersen asked this question in Q&A
Discussion options

You must be logged in to vote

Cluster Keyspace Notifications are hard to do right because a cluster changes its topology without a reliable source for change notifications. The only mechanism is polling for changes.

Is there some kind of Topology hook

Lettuce emits ClusterTopologyChangedEvent through its event bus. You can subscribe to ClientResources.eventBus().get() to listen for these events.

And secondarily, what's a good way to ensure that you only subscribe to the master cluster nodes

You can either subscribe through the NodeSelection API or track nodes yourself by inspecting Partitions.

Note that ReadFrom helps to route commands to replicas/master nodes, however keyspace notifications are active push messag…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jaredpetersen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants