public class MessageProducerImpl<T> extends Object implements MessageProducer<T>
| Constructor and Description |
|---|
MessageProducerImpl(Vertx vertx,
String address,
boolean send,
DeliveryOptions options) |
| Modifier and Type | Method and Description |
|---|---|
String |
address() |
Future<Void> |
close()
Closes the producer, this method should be called when the message producer is not used anymore.
|
void |
close(Handler<AsyncResult<Void>> handler)
Same as
MessageProducer.close() but with an handler called when the operation completes |
MessageProducer<T> |
deliveryOptions(DeliveryOptions options)
Update the delivery options of this producer.
|
Future<Void> |
write(T body)
Like
MessageProducer.write(Object, Handler) but returns a Future of the asynchronous result |
void |
write(T body,
Handler<AsyncResult<Void>> handler)
Write a message to the event-bus, either sending or publishing.
|
public MessageProducerImpl(Vertx vertx, String address, boolean send, DeliveryOptions options)
public MessageProducer<T> deliveryOptions(DeliveryOptions options)
MessageProducerdeliveryOptions in interface MessageProducer<T>options - the new optionspublic Future<Void> write(T body)
MessageProducerMessageProducer.write(Object, Handler) but returns a Future of the asynchronous resultwrite in interface MessageProducer<T>public void write(T body, Handler<AsyncResult<Void>> handler)
MessageProducerwrite in interface MessageProducer<T>body - the message bodyhandler - the handler called when the message has been successfully or failed to be written, this is not a delivery
guaranteepublic String address()
address in interface MessageProducer<T>public Future<Void> close()
MessageProducerclose in interface MessageProducer<T>public void close(Handler<AsyncResult<Void>> handler)
MessageProducerMessageProducer.close() but with an handler called when the operation completesclose in interface MessageProducer<T>Copyright © 2021. All rights reserved.