Package dev.agenor.core.messaging
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 Summary
Modifier and TypeMethodDescriptionsend(TransportEndpoint dest, Message msg) Sends a message to the given transport endpoint.subscribe(TransportEndpoint local, MessageHandler handler) Registers a handler for messages arriving at the given local transport endpoint.
-
Method Details
-
send
Sends a message to the given transport endpoint.- Parameters:
dest- the physical destination resolved by the dispatcher, must not be nullmsg- 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
Registers a handler for messages arriving at the given local transport endpoint.- Parameters:
local- the local endpoint to listen on, must not be nullhandler- the handler to invoke on each received message, must not be null- Returns:
- a
Subscriptionthat can be used to stop listening - Throws:
NullPointerException- if local or handler is null
-