Interface WithEventBus

All Superinterfaces:
io.vertx.core.Verticle
All Known Implementing Classes:
GenericSimpleCommandHandler, PingVerticle, PongVerticle, PositionPublisher, Publisher, RandomPositionPublisher, Receiver, Requester, Responder, SimpleCommandHandler, TestVerticle

public interface WithEventBus extends io.vertx.core.Verticle
Allows Verticle instances to get simplified access to the Vert.x event bus. These traits support automatic conversion of different message types like JsonMessage and automatic attachment of MultiMap or HeaderInformation to sent messages on the event bus.

Usage

 
 public class MyVerticle extends TelestionVerticle implements WithEventBus {
     @Override
     public void onStart() {
         register("channel-1", this::handle, Position.class);
     }

     private void handle(Position position) {
         logger.info("Current position: {}, {}", position.x, position.y);
     }
 }
 
 
  • Method Details

    • publish

      default void publish(String address, Object message)
      See Also:
      EventBus.publish(String, Object)
    • publish

      default void publish(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options)
      See Also:
      EventBus.publish(String, Object, DeliveryOptions)
    • publish

      default void publish(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options, io.vertx.core.MultiMap... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.publish(String, Object, DeliveryOptions)
    • publish

      default void publish(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options, HeaderInformation... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.publish(String, Object, DeliveryOptions)
    • publish

      default void publish(String address, Object message, io.vertx.core.MultiMap... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.publish(String, Object)
    • publish

      default void publish(String address, Object message, HeaderInformation... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.publish(String, Object)
    • publish

      default void publish(String address, JsonMessage message)
      See Also:
      EventBus.publish(String, Object)
    • publish

      default void publish(String address, JsonMessage message, io.vertx.core.eventbus.DeliveryOptions options)
      See Also:
      EventBus.publish(String, Object, DeliveryOptions)
    • publish

      default void publish(String address, JsonMessage message, io.vertx.core.eventbus.DeliveryOptions options, io.vertx.core.MultiMap... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.publish(String, Object, DeliveryOptions)
    • publish

      default void publish(String address, JsonMessage message, io.vertx.core.eventbus.DeliveryOptions options, HeaderInformation... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.publish(String, Object, DeliveryOptions)
    • publish

      default void publish(String address, JsonMessage message, io.vertx.core.MultiMap... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.publish(String, Object)
    • publish

      default void publish(String address, JsonMessage message, HeaderInformation... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.publish(String, Object)
    • send

      default void send(String address, Object message)
      See Also:
      EventBus.send(String, Object)
    • send

      default void send(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options)
      See Also:
      EventBus.send(String, Object, DeliveryOptions)
    • send

      default void send(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options, io.vertx.core.MultiMap... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.send(String, Object, DeliveryOptions)
    • send

      default void send(String address, Object message, io.vertx.core.eventbus.DeliveryOptions options, HeaderInformation... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.send(String, Object, DeliveryOptions)
    • send

      default void send(String address, Object message, io.vertx.core.MultiMap... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.send(String, Object)
    • send

      default void send(String address, Object message, HeaderInformation... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.send(String, Object)
    • send

      default void send(String address, JsonMessage message)
      See Also:
      EventBus.send(String, Object)
    • send

      default void send(String address, JsonMessage message, io.vertx.core.eventbus.DeliveryOptions options)
      See Also:
      EventBus.send(String, Object, DeliveryOptions)
    • send

      default void send(String address, JsonMessage message, io.vertx.core.eventbus.DeliveryOptions options, io.vertx.core.MultiMap... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.send(String, Object, DeliveryOptions)
    • send

      default void send(String address, JsonMessage message, io.vertx.core.eventbus.DeliveryOptions options, HeaderInformation... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.send(String, Object, DeliveryOptions)
    • send

      default void send(String address, JsonMessage message, io.vertx.core.MultiMap... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.send(String, Object)
    • send

      default void send(String address, JsonMessage message, HeaderInformation... headers)
      Parameters:
      headers - the headers that should be sent with the message
      See Also:
      EventBus.send(String, Object)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, Object request)
      See Also:
      EventBus.request(String, Object)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, Object request, io.vertx.core.eventbus.DeliveryOptions options)
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, Object request, io.vertx.core.eventbus.DeliveryOptions options, io.vertx.core.MultiMap... requestHeaders)
      Parameters:
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, Object request, io.vertx.core.eventbus.DeliveryOptions options, HeaderInformation... requestHeaders)
      Parameters:
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, Object request, io.vertx.core.MultiMap... requestHeaders)
      Parameters:
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, Object request, HeaderInformation... requestHeaders)
      Parameters:
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, JsonMessage message)
      See Also:
      EventBus.request(String, Object)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, JsonMessage message, io.vertx.core.eventbus.DeliveryOptions options)
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, JsonMessage message, io.vertx.core.eventbus.DeliveryOptions options, io.vertx.core.MultiMap... requestHeaders)
      Parameters:
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, JsonMessage message, io.vertx.core.eventbus.DeliveryOptions options, HeaderInformation... requestHeaders)
      Parameters:
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, JsonMessage message, io.vertx.core.MultiMap... requestHeaders)
      Parameters:
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object)
    • request

      default <T> io.vertx.core.Future<io.vertx.core.eventbus.Message<T>> request(String address, JsonMessage message, HeaderInformation... requestHeaders)
      Parameters:
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, Object request, Class<V> responseType)
      Parameters:
      responseType - the type of the response to map to
      See Also:
      EventBus.request(String, Object)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, Object request, Class<V> responseType, io.vertx.core.eventbus.DeliveryOptions options)
      Parameters:
      responseType - the type of the response to map to
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, Object request, Class<V> responseType, io.vertx.core.eventbus.DeliveryOptions options, io.vertx.core.MultiMap... requestHeaders)
      Parameters:
      responseType - the type of the response to map to
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, Object request, Class<V> responseType, io.vertx.core.eventbus.DeliveryOptions options, HeaderInformation... requestHeaders)
      Parameters:
      responseType - the type of the response to map to
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, Object request, Class<V> responseType, io.vertx.core.MultiMap... requestHeaders)
      Parameters:
      responseType - the type of the response to map to
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, Object request, Class<V> responseType, HeaderInformation... requestHeaders)
      Parameters:
      responseType - the type of the response to map to
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, JsonMessage request, Class<V> responseType)
      Parameters:
      responseType - the type of the response to map to
      See Also:
      EventBus.request(String, Object)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, JsonMessage request, Class<V> responseType, io.vertx.core.eventbus.DeliveryOptions options)
      Parameters:
      responseType - the type of the response to map to
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, JsonMessage request, Class<V> responseType, io.vertx.core.eventbus.DeliveryOptions options, io.vertx.core.MultiMap... requestHeaders)
      Parameters:
      responseType - the type of the response to map to
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, JsonMessage request, Class<V> responseType, io.vertx.core.eventbus.DeliveryOptions options, HeaderInformation... requestHeaders)
      Parameters:
      responseType - the type of the response to map to
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object, DeliveryOptions)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, JsonMessage request, Class<V> responseType, io.vertx.core.MultiMap... requestHeaders)
      Parameters:
      responseType - the type of the response to map to
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object)
    • request

      default <V extends JsonMessage,​ T extends io.vertx.core.json.JsonObject> io.vertx.core.Future<DecodedMessage<V,​T>> request(String address, JsonMessage request, Class<V> responseType, HeaderInformation... requestHeaders)
      Parameters:
      responseType - the type of the response to map to
      requestHeaders - the headers that should be sent with the request message
      See Also:
      EventBus.request(String, Object)
    • register

      default <T> void register(String address, io.vertx.core.Handler<io.vertx.core.eventbus.Message<T>> handler)
      See Also:
      EventBus.consumer(String, Handler)
    • register

      default <V extends JsonMessage> void register(String address, MessageHandler<V> handler, Class<V> type)
      Parameters:
      type - the type of received message to map to
      See Also:
      EventBus.consumer(String, Handler)
    • register

      default <V extends JsonMessage,​ T> void register(String address, ExtendedMessageHandler<V,​T> handler, Class<V> type)
      Parameters:
      type - the type of received message to map to
      See Also:
      EventBus.consumer(String, Handler)