|
The concept of messaging is greatly simplified with relation to the general-purpose library in that messages can be sent in only one direction. That is, there is no directly supported concept of message reply.
This might seem to be a serious limitation, but in fact opens much wider opportunities than those present in the general-purpose library, as the user can implement more elaborated message routing schemes, including, for example, the possibility to send many replies to a single message, message forwarding, time-related treatment like message expiration and many others.
The major contributor to this possibility is the fact that a user is in full control of the message header in addition to regular message parameters. The message header is just a separate parameters object that can be freely interpreted by the receiver. It is only up to the system implementer to decide how the header fields are interpreted and as such the header can be treated as a message meta-information. In the simplest case the header might be empty.
The application should perform the following steps to send an arbitrary message:
The above steps are typical for the message sender and of course any given channel can be used many times to send multiple messages, unless there is a communication error, in which case the channel is automatically closed.
The receiver is supposed to have some listener set up on its side.