Interface MessagingService


public interface MessagingService
Transient, at-most-once messaging. A successful publish only means Redis accepted the message.
  • Method Details

    • publish

      <T> CompletionStage<MessageId> publish(Topic<T> topic, Destination destination, T payload)
      Publishes a payload asynchronously.
      Type Parameters:
      T - payload type
      Parameters:
      topic - topic and codec used to encode the payload
      destination - target nodes
      payload - 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 payload
      destination - target nodes
      payload - value to publish
      options - optional correlation identifier and headers
      Returns:
      a stage completed when the transport accepts the publication
    • subscribe

      <T> Subscription subscribe(Topic<T> topic, MessageHandler<T> handler)
      Registers a handler for a topic.
      Type Parameters:
      T - payload type
      Parameters:
      topic - topic and codec used to decode messages
      handler - 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