Class RabbitMQPublisher
java.lang.Object
io.vertx.reactivex.rabbitmq.RabbitMQPublisher
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
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.
NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRabbitMQPublisher(RabbitMQPublisher delegate) RabbitMQPublisher(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionstatic RabbitMQPublishercreate(Vertx vertx, RabbitMQClient client, RabbitMQPublisherOptions options) Create and return a publisher using the specified client.booleanGet the ReadStream that contains the message IDs for confirmed messages.inthashCode()static RabbitMQPublisherpublish(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body) Publish a message.publishConfirm(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body) Publish a message and complete when publish confirm has returned.intGet the number of published, but not sent, messages.voidrestart()Undo the effects of calling so that publish may be called again.rxPublish(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body) Publish a message.rxPublishConfirm(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body) Publish a message and complete when publish confirm has returned.rxStart()Start the rabbitMQ publisher.rxStop()Stop the rabbitMQ publisher.start()Start the rabbitMQ publisher.stop()Stop the rabbitMQ publisher.toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
RabbitMQPublisher
-
RabbitMQPublisher
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
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
-
rxStart
Start the rabbitMQ publisher. The RabbitMQClient should have been started before this.- Returns:
-
stop
-
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 so that publish may be called again. It is harmless to call restart() when has not been called, however if restart() is called whilst is being processed the will never complete. -
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
-
rxPublish
public Completable rxPublish(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body) Publish a message.- Parameters:
exchange-routingKey-properties-body-- Returns:
-
publishConfirm
-
rxPublishConfirm
-
newInstance
-