public interface NodeSelector
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. |
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. |
void 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.Copyright © 2021 Eclipse. All rights reserved.