Class AlwaysConsistentMessageProducer<T>

java.lang.Object
kos.core.events.AlwaysConsistentMessageProducer<T>
All Implemented Interfaces:
io.vertx.core.eventbus.MessageProducer<T>

class AlwaysConsistentMessageProducer<T> extends Object implements io.vertx.core.eventbus.MessageProducer<T>
A bespoken MessageProducer implementation designed to provide always consistent semantics when sending messages to Vertx' EventBus. This class was implemented to allow EventPublisherSink to reliably send messages to a remote event broker, hence a few of its methods are just stubs and might fail if used outside this context.
  • Field Details

    • address

      private final String address
    • eventBus

      private final io.vertx.core.eventbus.EventBus eventBus
  • Constructor Details

    • AlwaysConsistentMessageProducer

      AlwaysConsistentMessageProducer()
  • Method Details

    • address

      public String address()
      Specified by:
      address in interface io.vertx.core.eventbus.MessageProducer<T>
    • write

      public io.vertx.core.Future<Void> write(T body)
      Specified by:
      write in interface io.vertx.core.eventbus.MessageProducer<T>
    • close

      public io.vertx.core.Future<Void> close()
      Specified by:
      close in interface io.vertx.core.eventbus.MessageProducer<T>
    • close

      public void close(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
      Specified by:
      close in interface io.vertx.core.eventbus.MessageProducer<T>
    • deliveryOptions

      public io.vertx.core.eventbus.MessageProducer<T> deliveryOptions(io.vertx.core.eventbus.DeliveryOptions options)
      Specified by:
      deliveryOptions in interface io.vertx.core.eventbus.MessageProducer<T>
    • write

      public void write(T body, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> handler)
      Specified by:
      write in interface io.vertx.core.eventbus.MessageProducer<T>