public interface NodeSelector extends VertxServiceProvider
clustered EventBus to select a node for a given message.
This selector is skipped only when the user raises the DeliveryOptions.setLocalOnly(boolean) flag.
Consequently, implementations must be aware of local EventBus registrations.
| Modifier and Type | Method and Description |
|---|---|
void |
eventBusStarted()
Invoked after the clustered
EventBus has started. |
default void |
init(io.vertx.core.impl.VertxBuilder builder)
Let the provider initialize the Vert.x builder.
|
void |
init(Vertx vertx,
ClusterManager clusterManager)
Invoked before the
vertx instance tries to join the cluster. |
void |
registrationsLost()
Invoked by the
ClusterManager when some handler registrations have been lost. |
void |
registrationsUpdated(RegistrationUpdateEvent event)
Invoked by the
ClusterManager when messaging handler registrations are added or removed. |
void |
selectForPublish(Message<?> message,
Promise<Iterable<String>> promise)
Select a node for publishing the given
message. |
void |
selectForSend(Message<?> message,
Promise<String> promise)
Select a node for sending the given
message. |
default boolean |
wantsUpdatesFor(String address)
Invoked by the
ClusterManager to determine if the node selector wants updates for the given address. |
default void init(io.vertx.core.impl.VertxBuilder builder)
VertxServiceProviderinit in interface VertxServiceProviderbuilder - the buildervoid init(Vertx vertx, ClusterManager clusterManager)
vertx instance tries to join the cluster.void eventBusStarted()
EventBus has started.void selectForSend(Message<?> message, Promise<String> promise)
message.
The provided promise needs to be completed with Promise.tryComplete(T) and Promise.tryFail(java.lang.Throwable)
as it might completed outside the selector.
IllegalArgumentException - if Message.isSend() returns falsevoid selectForPublish(Message<?> message, Promise<Iterable<String>> promise)
message.
The provided promise needs to be completed with Promise.tryComplete(T) and Promise.tryFail(java.lang.Throwable)
as it might completed outside the selector.
IllegalArgumentException - if Message.isSend() returns truevoid registrationsUpdated(RegistrationUpdateEvent event)
ClusterManager when messaging handler registrations are added or removed.void registrationsLost()
ClusterManager when some handler registrations have been lost.default boolean wantsUpdatesFor(String address)
ClusterManager to determine if the node selector wants updates for the given address.address - the event bus addresstrue if the node selector wants updates for the given address, false otherwiseCopyright © 2022 Eclipse. All rights reserved.