io.vertx.rxjava.rabbitmq

## Class RabbitMQPublisher

- java.lang.Object
- - io.vertx.rxjava.rabbitmq.RabbitMQPublisher

-     public class RabbitMQPublisher
      extends Object

  A reliable publisher that
  - Queues up messages internally until it can successfully call basicPublish.
  - Notifies the caller using a robust ID (not delivery tag) when the message is confirmed by rabbit.
  This is a layer above the RabbitMQClient that provides a lot of standard implementation when guaranteed at least once delivery is required. If confirmations are not required do not use this publisher as it does have overhead.

  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<RabbitMQPublisher>` | `__TYPE_ARG`

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static RabbitMQPublisher` | `create(Vertx vertx, RabbitMQClient client, RabbitMQPublisherOptions options)` Create and return a publisher using the specified client.
    `boolean` | `equals(Object o)`
    `ReadStream<RabbitMQPublisherConfirmation>` | `getConfirmationStream()` Get the ReadStream that contains the message IDs for confirmed messages.
    `RabbitMQPublisher` | `getDelegate()`
    `int` | `hashCode()`
    `static RabbitMQPublisher` | `newInstance(RabbitMQPublisher arg)`
    `void` | `publish(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body)` Publish a message.
    `void` | `publish(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body, Handler<AsyncResult<Void>> resultHandler)` Publish a message.
    `int` | `queueSize()` Get the number of published, but not sent, messages.
    `void` | `restart()` Undo the effects of calling `stop(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` so that publish may be called again.
    `Single<Void>` | `rxPublish(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body)` Publish a message.
    `Single<Void>` | `rxStart()` Start the rabbitMQ publisher.
    `Single<Void>` | `rxStop()` Stop the rabbitMQ publisher.
    `void` | `start()` Start the rabbitMQ publisher.
    `void` | `start(Handler<AsyncResult<Void>> resultHandler)` Start the rabbitMQ publisher.
    `void` | `stop()` Stop the rabbitMQ publisher.
    `void` | `stop(Handler<AsyncResult<Void>> resultHandler)` Stop the rabbitMQ publisher.
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### __TYPE_ARG

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

  - ### Constructor Detail

    - #### RabbitMQPublisher

          public RabbitMQPublisher(RabbitMQPublisher delegate)

    - #### RabbitMQPublisher

          public RabbitMQPublisher(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 RabbitMQPublisher getDelegate()

    - #### create

          public static RabbitMQPublisher create(Vertx vertx,
                                                 RabbitMQClient client,
                                                 RabbitMQPublisherOptions options)

      Create and return a publisher using the specified client.
      Parameters:
        `vertx` - the vertx instance.
        `client` - the RabbitMQClient.
        `options` - options for the publisher.
      Returns:
        the publisher

    - #### start

          public void start(Handler<AsyncResult<Void>> resultHandler)

      Start the rabbitMQ publisher. The RabbitMQClient should have been started before this.
      Parameters:
        `resultHandler` -

    - #### start

          public void start()

      Start the rabbitMQ publisher. The RabbitMQClient should have been started before this.

    - #### rxStart

          public Single<Void> rxStart()

      Start the rabbitMQ publisher. The RabbitMQClient should have been started before this.
      Returns:

    - #### stop

          public void stop(Handler<AsyncResult<Void>> resultHandler)

      Stop the rabbitMQ publisher. Calling this is optional, but it gives the opportunity to drain the send queue without losing messages. Future calls to publish will be ignored.
      Parameters:
        `resultHandler` -

    - #### stop

          public void stop()

      Stop the rabbitMQ publisher. Calling this is optional, but it gives the opportunity to drain the send queue without losing messages. Future calls to publish will be ignored.

    - #### rxStop

          public Single<Void> rxStop()

      Stop the rabbitMQ publisher. Calling this is optional, but it gives the opportunity to drain the send queue without losing messages. Future calls to publish will be ignored.
      Returns:

    - #### restart

          public void restart()

      Undo the effects of calling `stop(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` so that publish may be called again. It is harmless to call restart() when `stop(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` has not been called, however if restart() is called whilst `stop(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` is being processed the `stop(io.vertx.core.Handler<io.vertx.core.AsyncResult<java.lang.Void>>)` will never complete.

    - #### getConfirmationStream

          public ReadStream<RabbitMQPublisherConfirmation> getConfirmationStream()

      Get the ReadStream that contains the message IDs for confirmed messages. The message IDs in this ReadStream are taken from the message properties, if these message IDs are not set then this ReadStream will contain nulls and using this publisher will be pointless.
      Returns:
        the ReadStream that contains the message IDs for confirmed messages.

    - #### queueSize

          public int queueSize()

      Get the number of published, but not sent, messages.
      Returns:
        the number of published, but not sent, messages.

    - #### publish

          public void publish(String exchange,
                              String routingKey,
                              com.rabbitmq.client.BasicProperties properties,
                              Buffer body,
                              Handler<AsyncResult<Void>> resultHandler)

      Publish a message.
      Parameters:
        `exchange` -
        `routingKey` -
        `properties` -
        `body` -
        `resultHandler` -

    - #### publish

          public void publish(String exchange,
                              String routingKey,
                              com.rabbitmq.client.BasicProperties properties,
                              Buffer body)

      Publish a message.
      Parameters:
        `exchange` -
        `routingKey` -
        `properties` -
        `body` -

    - #### rxPublish

          public Single<Void> rxPublish(String exchange,
                                        String routingKey,
                                        com.rabbitmq.client.BasicProperties properties,
                                        Buffer body)

      Publish a message.
      Parameters:
        `exchange` -
        `routingKey` -
        `properties` -
        `body` -
      Returns:

    - #### newInstance

          public static RabbitMQPublisher newInstance(RabbitMQPublisher arg)

Copyright © 2021 Eclipse. All rights reserved.