Interface MessagingService
public interface MessagingService
Transient, at-most-once messaging. A successful publish only means Redis accepted the message.
-
Method Summary
Modifier and TypeMethodDescription<T> CompletionStage<MessageId> publish(Topic<T> topic, Destination destination, T payload) Publishes a payload asynchronously.default <T> CompletionStage<MessageId> publish(Topic<T> topic, Destination destination, T payload, PublishOptions options) Publishes a payload with correlation and application metadata.status()Returns a point-in-time view of messaging health and dispatch capacity.<T> Subscriptionsubscribe(Topic<T> topic, MessageHandler<T> handler) Registers a handler for a topic.
-
Method Details
-
publish
Publishes a payload asynchronously.- Type Parameters:
T- payload type- Parameters:
topic- topic and codec used to encode the payloaddestination- target nodespayload- value to publish- Returns:
- a stage completed with the message identifier once the transport accepts it
-
publish
default <T> CompletionStage<MessageId> publish(Topic<T> topic, Destination destination, T payload, PublishOptions options) Publishes a payload with correlation and application metadata.The default implementation preserves compatibility with third-party implementations that only support metadata-free publication.
- Type Parameters:
T- payload type- Parameters:
topic- topic and codec used to encode the payloaddestination- target nodespayload- value to publishoptions- optional correlation identifier and headers- Returns:
- a stage completed when the transport accepts the publication
-
subscribe
Registers a handler for a topic.- Type Parameters:
T- payload type- Parameters:
topic- topic and codec used to decode messageshandler- asynchronous message handler- Returns:
- a handle that removes the handler when closed
-
status
MessagingStatus status()Returns a point-in-time view of messaging health and dispatch capacity.- Returns:
- current status
-