Class RabbitMQPublisher
- java.lang.Object
- 
- io.vertx.mutiny.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.
 originalnon Mutiny-ified interface using Vert.x codegen.
- 
- 
Field SummaryFields Modifier and Type Field Description static TypeArg<RabbitMQPublisher>__TYPE_ARG
 - 
Constructor SummaryConstructors Constructor Description RabbitMQPublisher(io.vertx.rabbitmq.RabbitMQPublisher delegate)RabbitMQPublisher(Object delegate)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RabbitMQPublishercreate(Vertx vertx, RabbitMQClient client, io.vertx.rabbitmq.RabbitMQPublisherOptions options)booleanequals(Object o)ReadStream<io.vertx.rabbitmq.RabbitMQPublisherConfirmation>getConfirmationStream()io.vertx.rabbitmq.RabbitMQPublishergetDelegate()inthashCode()static RabbitMQPublishernewInstance(io.vertx.rabbitmq.RabbitMQPublisher arg)io.smallrye.mutiny.Uni<Void>publish(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body)Publish a message.VoidpublishAndAwait(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body)Blocking variant ofpublish(String,String,BasicProperties,io.vertx.mutiny.core.buffer.Buffer).voidpublishAndForget(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body)Variant ofpublish(String,String,BasicProperties,io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.intqueueSize()voidrestart()io.smallrye.mutiny.Uni<Void>start()Start the rabbitMQ publisher.VoidstartAndAwait()Blocking variant ofstart().voidstartAndForget()Variant ofstart()that ignores the result of the operation.io.smallrye.mutiny.Uni<Void>stop()Stop the rabbitMQ publisher.VoidstopAndAwait()Blocking variant ofstop().voidstopAndForget()Variant ofstop()that ignores the result of the operation.StringtoString()
 
- 
- 
- 
Field Detail- 
__TYPE_ARGpublic static final TypeArg<RabbitMQPublisher> __TYPE_ARG 
 
- 
 - 
Constructor Detail- 
RabbitMQPublisherpublic RabbitMQPublisher(io.vertx.rabbitmq.RabbitMQPublisher delegate) 
 - 
RabbitMQPublisherpublic RabbitMQPublisher(Object delegate) 
 
- 
 - 
Method Detail- 
getDelegatepublic io.vertx.rabbitmq.RabbitMQPublisher getDelegate() 
 - 
createpublic static RabbitMQPublisher create(Vertx vertx, RabbitMQClient client, io.vertx.rabbitmq.RabbitMQPublisherOptions options) - Parameters:
- vertx- the vertx instance.
- client- the RabbitMQClient.
- options- options for the publisher.
- Returns:
- the publisher
 
 - 
startpublic io.smallrye.mutiny.Uni<Void> start() Start the rabbitMQ publisher. The RabbitMQClient should have been started before this.Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
startAndAwaitpublic Void startAndAwait() Blocking variant ofstart().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Returns:
- the Void instance produced by the operation.
 
 - 
startAndForgetpublic void startAndForget() 
 - 
stoppublic io.smallrye.mutiny.Uni<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.Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
stopAndAwaitpublic Void stopAndAwait() Blocking variant ofstop().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Returns:
- the Void instance produced by the operation.
 
 - 
stopAndForgetpublic void stopAndForget() 
 - 
restartpublic void restart() 
 - 
getConfirmationStreampublic ReadStream<io.vertx.rabbitmq.RabbitMQPublisherConfirmation> getConfirmationStream() - Returns:
- the ReadStream that contains the message IDs for confirmed messages.
 
 - 
queueSizepublic int queueSize() - Returns:
- the number of published, but not sent, messages.
 
 - 
publishpublic io.smallrye.mutiny.Uni<Void> publish(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body) Publish a message.Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
- exchange-
- routingKey-
- properties-
- body-
- Returns:
- the unifiring the result of the operation when completed, or a failure if the operation failed.
 
 - 
publishAndAwaitpublic Void publishAndAwait(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body) Blocking variant ofpublish(String,String,BasicProperties,io.vertx.mutiny.core.buffer.Buffer).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException). - Parameters:
- exchange-
- routingKey-
- properties-
- body-
- Returns:
- the Void instance produced by the operation.
 
 - 
publishAndForgetpublic void publishAndForget(String exchange, String routingKey, com.rabbitmq.client.BasicProperties properties, Buffer body) Variant ofpublish(String,String,BasicProperties,io.vertx.mutiny.core.buffer.Buffer)that ignores the result of the operation.This method subscribes on the result of publish(String,String,BasicProperties,io.vertx.mutiny.core.buffer.Buffer), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation frompublish(String,String,BasicProperties,io.vertx.mutiny.core.buffer.Buffer)but you don't need to compose it with other operations.- Parameters:
- exchange-
- routingKey-
- properties-
- body-
 
 - 
newInstancepublic static RabbitMQPublisher newInstance(io.vertx.rabbitmq.RabbitMQPublisher arg) 
 
- 
 
-