Interface MessageTransport

All Known Implementing Classes:
RedisMessageTransport

public interface MessageTransport
Low-level transport primitive used by the message dispatcher — not by agents directly.

Each distributed backend (Redis, Kafka, …) provides a MessageTransport implementation. The dispatcher calls send(dev.agenor.core.TransportEndpoint, dev.agenor.core.Message) after resolving the target agent's AgentEndpoint to a TransportEndpoint. Local in-memory delivery short-circuits this layer entirely.

Since:
0.20.0
See Also:
  • Method Details

    • send

      Sends a message to the given transport endpoint.
      Parameters:
      dest - the physical destination resolved by the dispatcher, must not be null
      msg - the message to send, must not be null
      Returns:
      a future that completes when the message has been handed off to the transport
      Throws:
      NullPointerException - if dest or msg is null
    • subscribe

      Subscription subscribe(TransportEndpoint local, MessageHandler handler)
      Registers a handler for messages arriving at the given local transport endpoint.
      Parameters:
      local - the local endpoint to listen on, must not be null
      handler - the handler to invoke on each received message, must not be null
      Returns:
      a Subscription that can be used to stop listening
      Throws:
      NullPointerException - if local or handler is null