MikiLoz
MikiLoz

Reputation: 119

When clustering a Vert.x service, do clustered EventBus handlers propagate to new joining nodes?

This is something that I haven't been able to find in the official documentation nor anywhere else yet; the situtation I propose is basically this:

My question is actually two-fold:

Upvotes: 0

Views: 218

Answers (1)

tsegismont
tsegismont

Reputation: 9128

When you add a new node to the cluster, the app will be started again on this node (if if understood correctly the situation you described).

So on the new node, you'll register an EventBus consumer with for address A cluster-wide.

The new node will be aware of all registrations created previously on the cluster. The previous nodes will be aware of the new registration.

When you do eventBus().publish(A, ...) from the new-joiner, all nodes include it will invoke the consumer registered for this address.

On the new-joiner, the completion handler will be called when the registration has been persisted. There could be a (very small) delay before the new registration is visible from other nodes because the process is asynchronous.

The completion handler on previous nodes will not be invoked again (because the registration of the corresponding consumer already happened).

Upvotes: 1

Related Questions