An event-bus supports publish-subscribe messaging, point-to-point messaging and request-response messaging.
Message delivery is best-effort and messages can be lost if failure of all or part of the event bus occurs.
Please refer to the documentation for more information on the event bus.
| Modifier and Type | Field and Description |
|---|---|
| public static final Function | DEFAULT_SERIALIZABLE_CHECKER
Default |
| Modifier and Type | Method and Description |
|---|---|
| public <T> EventBus | Returns: a reference to this, so the API can be used fluentlythe interceptor interceptor)Add an interceptor that will be called whenever a message is received by Vert.x |
| public <T> EventBus | Returns: a reference to this, so the API can be used fluentlythe interceptor interceptor)Add an interceptor that will be called whenever a message is sent from Vert.x |
| public EventBus | Returns: a reference to this, so the API can be used fluentlythe predicate classNamePredicate)Register a predicate to invoke when verifying if an object is forbidden to be encoded/decoded as |
| public EventBus | Returns: a reference to this, so the API can be used fluentlythe codec selector selector)Set selector to be invoked when the bus has not found any codec for a |
| public <T> MessageConsumer | Returns: the event bus message consumerthe consumer options options)Create a message consumer against the specified options address. |
| public <T> MessageConsumer | Returns: the event bus message consumerthe consumer options options, Handler<Message<T>> the handler that will process the received messages handler)Create a consumer and register it against the specified options address. |
| public <T> MessageConsumer | |
| public <T> MessageConsumer | |
| public <T> MessageConsumer | Returns: the event bus message consumerthe address to register it at address)Like |
| public <T> MessageConsumer | Returns: the event bus message consumerthe address that will register it at address, Handler<Message<T>> the handler that will process the received messages handler)Like |
| public EventBus | |
| public EventBus | Returns: a reference to this, so the API can be used fluentlythe address to publish it to address, @Nullable Object the message, may be message, DeliveryOptions nullthe delivery options options)Like |
| public <T> MessageProducer | |
| public <T> MessageProducer | Returns: The publisherthe address to publish it to address, DeliveryOptions the delivery options options)Like |
| public EventBus | Returns: a reference to this, so the API can be used fluentlythe message codec to register codec)Register a message codec. |
| public <T> EventBus | Returns: a reference to this, so the API can be used fluentlythe class for which to use this codec clazz, MessageCodec<T, ?> the message codec to register codec)Register a default message codec. |
| public <T> EventBus | Returns: a reference to this, so the API can be used fluentlythe interceptor interceptor)Remove an interceptor that was added by |
| public <T> EventBus | Returns: a reference to this, so the API can be used fluentlythe interceptor interceptor)Remove an interceptor that was added by |
| public default <T> EventBus | Returns: a reference to this, so the API can be used fluentlythe address to send it to address, @Nullable Object the message body, may be message, Handler<AsyncResult<Message<T>>> nullreply handler will be called when any reply from the recipient is received replyHandler)Sends a message and specify a |
| public default <T> Future | request(String address, @Nullable Object message)
Like |
| public default <T> EventBus | Returns: a reference to this, so the API can be used fluentlythe address to send it to address, @Nullable Object the message body, may be message, DeliveryOptions nulldelivery options options, Handler<AsyncResult<Message<T>>> reply handler will be called when any reply from the recipient is received replyHandler)Like |
| public <T> Future | request(String address, @Nullable Object message, DeliveryOptions options)
Like |
| public EventBus | |
| public EventBus | Returns: a reference to this, so the API can be used fluentlythe address to send it to address, @Nullable Object the message, may be message, DeliveryOptions nulldelivery options options)Like |
| public <T> MessageProducer | |
| public <T> MessageProducer | Returns: The senderthe address to send it to address, DeliveryOptions the delivery options options)Like |
| public EventBus | Returns: a reference to this, so the API can be used fluentlythe predicate classNamePredicate)Register a predicate to invoke when verifying if an object is allowed to be encoded/decoded as |
| public EventBus | Returns: a reference to this, so the API can be used fluentlythe name of the codec name)Unregister a message codec. |
| public EventBus | Returns: a reference to this, so the API can be used fluentlythe class for which the codec was registered clazz)Unregister a default message codec. |
| DEFAULT_SERIALIZABLE_CHECKER | back to summary |
|---|---|
| public static final Function<String, Boolean> DEFAULT_SERIALIZABLE_CHECKER Default | |
| addInboundInterceptor | back to summary |
|---|---|
| public <T> EventBus addInboundInterceptor(Handler<DeliveryContext<T>> interceptor) Add an interceptor that will be called whenever a message is received by Vert.x
| |
| addOutboundInterceptor | back to summary |
|---|---|
| public <T> EventBus addOutboundInterceptor(Handler<DeliveryContext<T>> interceptor) Add an interceptor that will be called whenever a message is sent from Vert.x
| |
| clusterSerializableChecker | back to summary |
|---|---|
| public EventBus clusterSerializableChecker(Function<String, Boolean> classNamePredicate) Register a predicate to invoke when verifying if an object is forbidden to be encoded/decoded as This is only used when Vert.x is clustered. | |
| codecSelector | back to summary |
|---|---|
| public EventBus codecSelector(Function<Object, String> selector) Set selector to be invoked when the bus has not found any codec for a
The selector must return the name of a codec which has been registered with either | |
| consumer | back to summary |
|---|---|
| public <T> MessageConsumer Create a message consumer against the specified options address.
The returned consumer is not yet registered
at the address, registration will be effective when
| |
| consumer | back to summary |
|---|---|
| public <T> MessageConsumer Create a consumer and register it against the specified options address.
| |
| consumer | back to summary |
|---|---|
| public <T> MessageConsumer Create a message consumer against the specified address.
The returned consumer is not yet registered
at the address, registration will be effective when
| |
| consumer | back to summary |
|---|---|
| public <T> MessageConsumer Create a consumer and register it against the specified address.
| |
| localConsumer | back to summary |
|---|---|
| public <T> MessageConsumer Like
| |
| localConsumer | back to summary |
|---|---|
| public <T> MessageConsumer Like
| |
| publish | back to summary |
|---|---|
| public EventBus publish(String address, @Nullable Object message) Publish a message. The message will be delivered to all handlers registered to the address. | |
| publish | back to summary |
|---|---|
| public EventBus publish(String address, @Nullable Object message, DeliveryOptions options) Like | |
| publisher | back to summary |
|---|---|
| public <T> MessageProducer Create a message publisher against the specified address.
The returned publisher will invoke the
| |
| publisher | back to summary |
|---|---|
| public <T> MessageProducer Like
| |
| registerCodec | back to summary |
|---|---|
| public EventBus registerCodec(MessageCodec<S, R> codec) Register a message codec. You can register a message codec if you want to send any non standard message across the event bus. E.g. you might want to send POJOs directly across the event bus. To use a message codec for a send, you should specify it in the delivery options.
| |
| registerDefaultCodec | back to summary |
|---|---|
| public <T> EventBus registerDefaultCodec(Class<T> clazz, MessageCodec<T, ?> codec) Register a default message codec. You can register a message codec if you want to send any non standard message across the event bus. E.g. you might want to send POJOs directly across the event bus. Default message codecs will be used to serialise any messages of the specified type on the event bus without the codec having to be specified in the delivery options.
| |
| removeInboundInterceptor | back to summary |
|---|---|
| public <T> EventBus removeInboundInterceptor(Handler<DeliveryContext<T>> interceptor) Remove an interceptor that was added by
| |
| removeOutboundInterceptor | back to summary |
|---|---|
| public <T> EventBus removeOutboundInterceptor(Handler<DeliveryContext<T>> interceptor) Remove an interceptor that was added by
| |
| request | back to summary |
|---|---|
| public default <T> EventBus request(String address, @Nullable Object message, Handler<AsyncResult<Message<T>>> replyHandler) Sends a message and specify a The message will be delivered to at most one of the handlers registered to the address.
| |
| request | back to summary |
|---|---|
| public default <T> Future Like | |
| request | back to summary |
|---|---|
| public default <T> EventBus request(String address, @Nullable Object message, DeliveryOptions options, Handler<AsyncResult<Message<T>>> replyHandler) Like
| |
| request | back to summary |
|---|---|
| public <T> Future Like | |
| send | back to summary |
|---|---|
| public EventBus send(String address, @Nullable Object message) Sends a message. The message will be delivered to at most one of the handlers registered to the address. | |
| send | back to summary |
|---|---|
| public EventBus send(String address, @Nullable Object message, DeliveryOptions options) Like | |
| sender | back to summary |
|---|---|
| public <T> MessageProducer Create a message sender against the specified address.
The returned sender will invoke the
| |
| sender | back to summary |
|---|---|
| public <T> MessageProducer Like
| |
| serializableChecker | back to summary |
|---|---|
| public EventBus serializableChecker(Function<String, Boolean> classNamePredicate) Register a predicate to invoke when verifying if an object is allowed to be encoded/decoded as This is only used when Vert.x is clustered. | |
| unregisterCodec | back to summary |
|---|---|
| public EventBus unregisterCodec(String name) Unregister a message codec.
| |
| unregisterDefaultCodec | back to summary |
|---|---|
| public EventBus unregisterDefaultCodec(Class<T> clazz) Unregister a default message codec. | |