Package io.vertx.core.eventbus
Interface MessageProducer<T>
-
public interface MessageProducer<T>
Represents a stream of message that can be written to.- Author:
- Julien Viet
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
address()
Future<Void>
close()
Closes the producer, this method should be called when the message producer is not used anymore.MessageProducer<T>
deliveryOptions(DeliveryOptions options)
Update the delivery options of this producer.Future<Void>
write(T body)
Write a message to the event-bus, either sending or publishing.
-
-
-
Method Detail
-
deliveryOptions
MessageProducer<T> deliveryOptions(DeliveryOptions options)
Update the delivery options of this producer.- Parameters:
options
- the new options- Returns:
- this producer object
-
address
String address()
- Returns:
- The address to which the producer produces messages.
-
write
Future<Void> write(T body)
Write a message to the event-bus, either sending or publishing. The returnedFuture
completion depends on the producer type:- send or request: the future is completed successfully if the message has been written; otherwise, the future is failed
- publish: the future is failed if there is no recipient; otherwise, the future is completed successfully
Future
is not a delivery guarantee.- Parameters:
body
- the message body
-
-