io.vertx.core.eventbus

## Interface MessageProducer<T>

-     public interface MessageProducer<T>

  Represents a stream of message that can be written to.

  Author:
    Julien Viet

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `address()`
    `Future<Void>` | `close()` Closes the producer, this method should be called when the message producer is not used anymore.
    `void` | `close(Handler<AsyncResult<Void>> handler)` Same as `close()` but with an `handler` called when the operation completes
    `MessageProducer<T>` | `deliveryOptions(DeliveryOptions options)` Update the delivery options of this producer.
    `Future<Void>` | `write(T body)` Like `write(Object, Handler)` but returns a `Future` of the asynchronous result
    `void` | `write(T body, Handler<AsyncResult<Void>> handler)` Write a message to the event-bus, either sending or publishing.

- - ### Method Detail

    - #### deliveryOptions

          MessageProducer<T> deliveryOptions(DeliveryOptions options)

      Update the delivery options of this producer.
      Parameters:
        `options` - the new options
      Returns:
        this producer object

    - #### address

          String address()

      Returns:
        The address to which the producer produces messages.

    - #### write

          void write(T body,
                     Handler<AsyncResult<Void>> handler)

      Write a message to the event-bus, either sending or publishing.
      Parameters:
        `body` - the message body
        `handler` - the handler called when the message has been successfully or failed to be written, this is not a delivery guarantee

    - #### write

          Future<Void> write(T body)

      Like `write(Object, Handler)` but returns a `Future` of the asynchronous result

    - #### close

          Future<Void> close()

      Closes the producer, this method should be called when the message producer is not used anymore.
      Returns:
        a future completed with the result

    - #### close

          void close(Handler<AsyncResult<Void>> handler)

      Same as `close()` but with an `handler` called when the operation completes

Copyright © 2020 Eclipse. All rights reserved.