Message routing
Message routing can be split up into the routing of incoming and outgoing Messages
.
Incoming Messages
Connections
receiveEnvelopes
which they deposit inInBox
AgentLoop
's react picksEnvelopes
off theInBox
- the AEA tries to decode the message; errors are handled by the error
Skill
Messages
are dispatched to all relevantHandlers
. To limit dispatch to a specificHandler
in a specificSkill
theEnvelopeContext
can be used to reference a uniqueskill id
.
Outgoing Messages
Skills
depositMessages
inOutBox
OutBox
constructs anEnvelope
from theMessage
-
Multiplexer
assigns messages to relevantConnection
based on three rules:- checks if
EnvelopeContext
exists and specifies aConnection
, if so uses that else - checks if default routing is specified for the
protocol_id
referenced in theEnvelope
, if so uses that else - sends to default
Connection
.
- checks if
-
Connections
can encode envelopes where necessary or pass them on for transport to another agent
Address fields in Envelopes
/Messages
Addresses can reference agents or components within an agent. If the address references an agent then it must follow the address standard of agents. If the address references a component then it must be a public id.