public interface MessageProducer<T>
Message producers are responsible for producing messages to a DistributedMessageBus
topic. Producers are created via DistributedMessageBus.producer(String). Messages produced
by the producer are sent in round-robin order to listening MessageConsumers. If more than
one consumer is listening on the topic, only one consumer will receive any given message.
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
close()
Closes the producer.
|
<U> CompletableFuture<U> |
send(T message)
Sends a message to a consumer for the topic.
|
String |
topic()
Returns the topic for which the producer produces messages.
|
String topic()
<U> CompletableFuture<U> send(T message)
If no consumers are listening to the topic(), the returned CompletableFuture
will be immediately completed. If multiple consumers are listening to the topic, the message will
be sent to only one consumer. Consumers are rotated in round-robin order.
U - The message response type.message - The message to send.CompletableFuture<Void> close()
Copyright © 2013–2015. All rights reserved.