|
This chapter explains how the meta-information in message headers is used to implement message routing at the level of general-purpose libraries. This information might be of interest to those who need to integrate a system containing programs using general-purpose library with programs using only core components.
At the high level, there are two types of messages: messages (requests) and replies. Both of them are seen by the YAMI low-level infrastructure as just plain messages and their proper interpretation (that is, assignment of replies to corresponding requests) is up to the high-level components. This association is done thanks to the meta-information that is passed in message headers.
Those messages which are requests (they are known as outgoing/incoming messages and are sent from clients to servers) have the following fields in their message headers:
type
(string) - type identifier with exact value "message"
object_name
(string) - name of conceptual destination objectmessage_name
(string) - name of messagemessage_id
(long long) - identifier of the request; this identifier is generated by the client and is used to match replies to requestsThose messages that are replies (they are sent from servers to clients) have the following fields in their message headers:
type
(string) - type identifier with exact value "reply"
message_id
(long long) - identifier of the original requestThose messages that are rejections (exceptions, sent from servers to clients) have the following fields in their message headers:
type
(string) - type identifier with exact value "exception"
message_id
(long long) - identifier of the original requestreason
(string) - description of the exceptionIn all these cases, message headers are filled in automatically by the library.