io.vertx.reactivex.amqp

## Class AmqpSender

- java.lang.Object
- - io.vertx.reactivex.amqp.AmqpSender

- All Implemented Interfaces:
    StreamBase, WriteStream<AmqpMessage>

      public class AmqpSender
      extends Object
      implements WriteStream<AmqpMessage>

  AMQP Sender interface used to send messages.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<AmqpSender>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AmqpSender(AmqpSender delegate)`
    `AmqpSender(Object delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `address()`
    `void` | `close(Handler<AsyncResult<Void>> handler)` Closes the sender.
    `AmqpConnection` | `connection()` Gets the connection having created the sender.
    `WriteStream<AmqpMessage>` | `drainHandler(Handler<Void> handler)` Set a drain handler on the stream.
    `void` | `end()` Ends the stream.
    `void` | `end(AmqpMessage data)` Same as `WriteStream.end()` but writes some data to the stream before ending.
    `void` | `end(AmqpMessage data, Handler<AsyncResult<Void>> handler)` Same as but with an `handler` called when the operation completes
    `void` | `end(Handler<AsyncResult<Void>> handler)` Same as `WriteStream.end()` but with an `handler` called when the operation completes
    `boolean` | `equals(Object o)`
    `AmqpSender` | `exceptionHandler(Handler<Throwable> handler)` Set an exception handler on the write stream.
    `AmqpSender` | `getDelegate()`
    `int` | `hashCode()`
    `static AmqpSender` | `newInstance(AmqpSender arg)`
    `Completable` | `rxClose()` Closes the sender.
    `Completable` | `rxEnd()` Same as `WriteStream.end()` but with an `handler` called when the operation completes
    `Completable` | `rxEnd(AmqpMessage data)` Same as but with an `handler` called when the operation completes
    `Completable` | `rxSendWithAck(AmqpMessage message)` Sends an AMQP message and waits for an acknowledgement.
    `Completable` | `rxWrite(AmqpMessage data)`
    `AmqpSender` | `send(AmqpMessage message)` Sends an AMQP message.
    `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`.
    `io.vertx.reactivex.WriteStreamObserver<AmqpMessage>` | `toObserver()`
    `String` | `toString()`
    `io.vertx.reactivex.WriteStreamSubscriber<AmqpMessage>` | `toSubscriber()`
    `AmqpSender` | `write(AmqpMessage data)` Write some data to the stream.
    `AmqpSender` | `write(AmqpMessage data, Handler<AsyncResult<Void>> handler)` Same as but with an `handler` called when the operation completes
    `boolean` | `writeQueueFull()` This will return `true` if there are more bytes in the write queue than the value set using `setWriteQueueMaxSize(int)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

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

      `newInstance, newInstance`

    - ### Methods inherited from interface io.vertx.reactivex.core.streams.StreamBase

      `newInstance`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<AmqpSender> __TYPE_ARG

  - ### Constructor Detail

    - #### AmqpSender

          public AmqpSender(AmqpSender delegate)

    - #### AmqpSender

          public AmqpSender(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public AmqpSender getDelegate()

      Specified by:
        `getDelegate` in interface `StreamBase`
      Specified by:
        `getDelegate` in interface `WriteStream<AmqpMessage>`

    - #### toObserver

          public io.vertx.reactivex.WriteStreamObserver<AmqpMessage> toObserver()

    - #### toSubscriber

          public io.vertx.reactivex.WriteStreamSubscriber<AmqpMessage> toSubscriber()

    - #### end

          public void end()

      Ends the stream.

      Once the stream has ended, it cannot be used any more.

      Specified by:
        `end` in interface `WriteStream<AmqpMessage>`

    - #### end

          public void end(Handler<AsyncResult<Void>> handler)

      Same as `WriteStream.end()` but with an `handler` called when the operation completes
      Specified by:
        `end` in interface `WriteStream<AmqpMessage>`
      Parameters:
        `handler` -

    - #### rxEnd

          public Completable rxEnd()

      Same as `WriteStream.end()` but with an `handler` called when the operation completes
      Returns:

    - #### end

          public void end(AmqpMessage data)

      Same as `WriteStream.end()` but writes some data to the stream before ending.
      Specified by:
        `end` in interface `WriteStream<AmqpMessage>`
      Parameters:
        `data` - the data to write

    - #### end

          public void end(AmqpMessage data,
                          Handler<AsyncResult<Void>> handler)

      Same as but with an `handler` called when the operation completes
      Specified by:
        `end` in interface `WriteStream<AmqpMessage>`
      Parameters:
        `data` -
        `handler` -

    - #### rxEnd

          public Completable rxEnd(AmqpMessage data)

      Same as but with an `handler` called when the operation completes
      Parameters:
        `data` -
      Returns:

    - #### writeQueueFull

          public boolean writeQueueFull()

      This will return `true` if there are more bytes in the write queue than the value set using `setWriteQueueMaxSize(int)`
      Specified by:
        `writeQueueFull` in interface `WriteStream<AmqpMessage>`
      Returns:
        true if write queue is full

    - #### drainHandler

          public WriteStream<AmqpMessage> drainHandler(Handler<Void> handler)

      Set a drain handler on the stream. If the write queue is full, then the handler will be called when the write queue is ready to accept buffers again. See for an example of this being used.

      The stream implementation defines when the drain handler, for example it could be when the queue size has been reduced to `maxSize / 2`.
      Specified by:
        `drainHandler` in interface `WriteStream<AmqpMessage>`
      Parameters:
        `handler` - the handler
      Returns:
        a reference to this, so the API can be used fluently

    - #### write

          public AmqpSender write(AmqpMessage data)

      Description copied from interface: `WriteStream`
      Write some data to the stream. The data is put on an internal write queue, and the write actually happens asynchronously. To avoid running out of memory by putting too much on the write queue, check the `WriteStream.writeQueueFull()` method before writing. This is done automatically if using a `Pump`.
      Specified by:
        `write` in interface `WriteStream<AmqpMessage>`
      Parameters:
        `data` - the data to write
      Returns:
        a reference to this, so the API can be used fluently

    - #### write

          public AmqpSender write(AmqpMessage data,
                                  Handler<AsyncResult<Void>> handler)

      Description copied from interface: `WriteStream`
      Same as but with an `handler` called when the operation completes
      Specified by:
        `write` in interface `WriteStream<AmqpMessage>`
      Returns:

    - #### rxWrite

          public Completable rxWrite(AmqpMessage data)

    - #### exceptionHandler

          public 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

          public 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 `Pump` to provide flow control.

      The value is defined by the implementation of the stream, e.g in bytes for a `NetSocket`, the number of `Message` for a `MessageProducer`, 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

          public 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

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

      Sends an AMQP message and waits for an acknowledgement. The acknowledgement handler is called with an 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

    - #### rxSendWithAck

          public Completable rxSendWithAck(AmqpMessage message)

      Sends an AMQP message and waits for an acknowledgement. The acknowledgement handler is called with an 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:
        the current sender

    - #### close

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

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

    - #### rxClose

          public Completable rxClose()

      Closes the sender.
      Returns:

    - #### address

          public String address()

      Returns:
        the configured address.

    - #### connection

          public AmqpConnection connection()

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

    - #### newInstance

          public static AmqpSender newInstance(AmqpSender arg)

Copyright © 2020 Eclipse. All rights reserved.