Class AlwaysConsistentMessageProducer<T>

  • All Implemented Interfaces:
    io.vertx.core.eventbus.MessageProducer<T>

    class AlwaysConsistentMessageProducer<T>
    extends Object
    implements io.vertx.core.eventbus.MessageProducer<T>
    A bespoke 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 Detail

      • address

        private final String address
      • eventBus

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

      • AlwaysConsistentMessageProducer

        AlwaysConsistentMessageProducer()
    • Method Detail

      • 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>