Package dev.agenor.core.directory
Interface AgentResolver
- All Known Subinterfaces:
AgentDirectory
- All Known Implementing Classes:
CompositeAgentDirectory,InMemoryAgentDirectory,JdbcAgentResolver
public interface AgentResolver
Hot-path capability for resolving an agent ID to its transport endpoint.
Called on every MessageDispatcher.sendTo(agentId, msg) invocation, so
implementations must be fast. In-memory implementations return immediately; remote
implementations should cache recent resolutions.
Returns empty when the agent is unknown or has no registered endpoint. The dispatcher
converts an empty result into an
AgentNotFoundException.
- Since:
- 0.20.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionresolveEndpoint(String agentId) Resolves the transport endpoint for the given agent ID.
-
Method Details
-
resolveEndpoint
Resolves the transport endpoint for the given agent ID.- Parameters:
agentId- the unique agent identifier, must not be null- Returns:
- a future containing the endpoint if the agent is registered and reachable, or empty if the agent is unknown
- Throws:
NullPointerException- if agentId is null
-