Package io.vertx.amqp

## Interface AmqpSender

- All Superinterfaces:
    `StreamBase`, `WriteStream<AmqpMessage>`

      public interface AmqpSender
      extends WriteStream<AmqpMessage>

  AMQP Sender interface used to send messages.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `address()` |
    `Future<Void>` | `close()` | Closes the sender.
    `AmqpConnection` | `connection()` | Gets the connection having created the sender.
    `AmqpSender` | `exceptionHandler​(Handler<Throwable> handler)` | Set an exception handler on the write stream.
    `long` | `remainingCredits()` |
    `AmqpSender` | `send​(AmqpMessage message)` | Sends an AMQP message.
    `Future<Void>` | `sendWithAck​(AmqpMessage message)` | Sends an AMQP message and waits for an acknowledgement.
    `AmqpSender` | `setWriteQueueMaxSize​(int maxSize)` | Set the maximum size of the write queue to `maxSize`.
    `io.vertx.proton.ProtonSender` | `unwrap()` |

    - ### Methods inherited from interface io.vertx.core.streams.WriteStream

      `drainHandler, end, end, write, writeQueueFull`

- - ### Method Detail

    - #### exceptionHandler

          AmqpSender exceptionHandler​(Handler<Throwable> handler)

      Description copied from interface: `WriteStream`
      Set an exception handler on the write stream.
      Specified by:
        `exceptionHandler` in interface `StreamBase`
      Specified by:
        `exceptionHandler` in interface `WriteStream<AmqpMessage>`
      Parameters:
        `handler` - the exception handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### setWriteQueueMaxSize

          AmqpSender setWriteQueueMaxSize​(int maxSize)

      Description copied from interface: `WriteStream`
      Set the maximum size of the write queue to `maxSize`. You will still be able to write to the stream even if there is more than `maxSize` items in the write queue. This is used as an indicator by classes such as `Pipe` to provide flow control.

      The value is defined by the implementation of the stream, e.g in bytes for a `NetSocket`, etc...
      Specified by:
        `setWriteQueueMaxSize` in interface `WriteStream<AmqpMessage>`
      Parameters:
        `maxSize` - the max size of the write stream
      Returns:
        a reference to this, so the API can be used fluently

    - #### send

          AmqpSender send​(AmqpMessage message)

      Sends an AMQP message. The destination the configured sender address or the address configured in the message.
      Parameters:
        `message` - the message, must not be `null`
      Returns:
        the current sender

    - #### sendWithAck

          Future<Void> sendWithAck​(AmqpMessage message)

      Sends an AMQP message and waits for an acknowledgement. It returns a future marked as failed if the message has been rejected or re-routed. If the message has been accepted, the handler is called with a success.
      Parameters:
        `message` - the message, must not be `null`
      Returns:
        a future notified with the acknowledgement

    - #### close

          Future<Void> close()

      Closes the sender.
      Returns:
        a future notified when the sender has been closed

    - #### address

          String address()

      Returns:
        the configured address.

    - #### connection

          AmqpConnection connection()

      Gets the connection having created the sender. Cannot be `null`
      Returns:
        the connection having created the sender.

    - #### remainingCredits

          long remainingCredits()

      Returns:
        the remaining credit, 0 is none.

    - #### unwrap

          io.vertx.proton.ProtonSender unwrap()

      Returns:
        the underlying ProtonSender.