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 and Description
    --- | ---
    `String` | `address()`
    `Future<Void>` | `close()` Like `close(Handler)` but returns a `Future` of the asynchronous result
    `void` | `close(Handler<AsyncResult<Void>> handler)` 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)` Like `sendWithAck(AmqpMessage, Handler)` but returns a `Future` of the asynchronous result
    `AmqpSender` | `sendWithAck(AmqpMessage message, Handler<AsyncResult<Void>> acknowledgementHandler)` Sends an AMQP message and waits for an acknowledgement.
    `AmqpSender` | `setWriteQueueMaxSize(int maxSize)` Set the maximum size of the write queue to `maxSize`.

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

      `drainHandler, end, end, end, end, write, 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

          AmqpSender sendWithAck(AmqpMessage message,
                                 Handler<AsyncResult<Void>> acknowledgementHandler)

      Sends an AMQP message and waits for an acknowledgement. The acknowledgement handler is called with an `AsyncResult` 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`
        `acknowledgementHandler` - the acknowledgement handler, must not be `null`
      Returns:
        the current sender

    - #### sendWithAck

          Future<Void> sendWithAck(AmqpMessage message)

      Like `sendWithAck(AmqpMessage, Handler)` but returns a `Future` of the asynchronous result

    - #### close

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

      Closes the sender.
      Parameters:
        `handler` - called when the sender has been closed, must not be `null`

    - #### close

          Future<Void> close()

      Like `close(Handler)` but returns a `Future` of the asynchronous result

    - #### 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.

Copyright © 2021 Eclipse. All rights reserved.