Package: io.vertx.groovy.core.eventbus

## [Groovy] Class MessageProducer<T>

- io.vertx.groovy.core.eventbus.MessageProducer

- All Implemented Interfaces and Traits:
    WriteStream

      @groovy.transform.CompileStatic
      class MessageProducer
      extends java.lang.Object

  Represents a stream of message that can be written to.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `MessageProducer (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `java.lang.String` | `address()` Returns: The address to which the producer produces messages.
    `void` | `close()` Closes the producer, this method should be called when the message producer is not used anymore.
    `MessageProducer<T>` | `deliveryOptions(java.util.Map<java.lang.String, java.lang.Object> options = [:])` Update the delivery options of this producer.
    `MessageProducer<T>` | `drainHandler(io.vertx.core.Handler<java.lang.Void> handler)`
    `void` | `end(T t)` Same as MessageProducer.end but writes some data to the stream before ending.
    `void` | `end()` Closes the producer, calls MessageProducer.close
    `MessageProducer<T>` | `exceptionHandler(io.vertx.core.Handler<java.lang.Throwable> handler)`
    `java.lang.Object` | `getDelegate()`
    `MessageProducer<T>` | `send(T message)` Synonym for MessageProducer.write.
    `MessageProducer<T>` | `send(T message, io.vertx.core.Handler<io.vertx.core.AsyncResult<Message<R>>> replyHandler)`
    `MessageProducer<T>` | `setWriteQueueMaxSize(int maxSize)`
    `MessageProducer<T>` | `write(T data)`
    `boolean` | `writeQueueFull()` This will return `true` if there are more bytes in the write queue than the value set using MessageProducer.setWriteQueueMaxSize

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### MessageProducer(java.lang.Object delegate)

  - ### Method Detail

    - #### java.lang.String address()

      Returns:
        The address to which the producer produces messages.

    - #### void close()

      Closes the producer, this method should be called when the message producer is not used anymore.

    - #### MessageProducer<T> deliveryOptions(java.util.Map<java.lang.String, java.lang.Object> options = [:])

      Update the delivery options of this producer.

      Returns:
        this producer object
      Parameters:
        `options` - the new options (see DeliveryOptions)

    - #### MessageProducer<T> drainHandler(io.vertx.core.Handler<java.lang.Void> handler)

    - #### void end(T t)

      Same as MessageProducer.end but writes some data to the stream before ending.

      Parameters:
        t

    - #### void end()

      Closes the producer, calls MessageProducer.close

    - #### MessageProducer<T> exceptionHandler(io.vertx.core.Handler<java.lang.Throwable> handler)

    - #### java.lang.Object getDelegate()

    - #### MessageProducer<T> send(T message)

      Synonym for MessageProducer.write.

      Returns:
        reference to this for fluency
      Parameters:
        `message` - the message to send

    - #### MessageProducer<T> send(T message, io.vertx.core.Handler<io.vertx.core.AsyncResult<Message<R>>> replyHandler)

    - #### MessageProducer<T> setWriteQueueMaxSize(int maxSize)

    - #### MessageProducer<T> write(T data)

    - #### boolean writeQueueFull()

      This will return `true` if there are more bytes in the write queue than the value set using MessageProducer.setWriteQueueMaxSize

      Returns:
        true if write queue is full