Message servers such as Field [Rei90], YEAST [Kri91], and the CB Message Bus [Kap92] allow a client to exchange messages with remote clients without being aware of the identities of the remote clients or the messages in which they are interested. Each client sends to the message server messages regarding all possible changes to its state that other clients may be interested in. In addition, it registers message patterns with the server that describe the specific set of messages from other clients in which it is interested. The message server forwards a message sent by a client to all other clients who have registered patterns matching the message. A client is not aware of the patterns registered by other clients or even the identities of these clients. Figure 8.6 shows the architecture of a multiuser application developed using a message server and Figure 8.7 shows the main steps performed by a client.
Figure: Message Servers
Figure: Client of a Message Server
Implementing the example user interface: Each client sends to the message server messages announcing all changes to the state of both windows.
Moreover, it registers patterns with the server that request messages regarding changes to the complete state of the test windows and the semantic state of the edit windows. Thus, the message server forwards to a client messages regarding changes to the scrollbars of the remote test windows but not the edit windows.
If one of the clients wishes to not share the positions of scrollbars of a remote test window, it only has to register a new pattern with the message server. It does not have to directly communicate with the remote client, which is unaware of its interests. As a result, it is easy to change the sharing between two clients. Moreover, it is easy to add new users to the application since their clients have to communicate only with the message server and not the existing clients.
A message server combines benefits of database systems and distributed systems by allowing clients to exchange data without polling or being aware of each other. It does not, however, combine all the benefits of the previous two tools. In particular, like distributed systems, it does not provide concurrency control or access control since it has no notion of shared state. Moreover, it does not relieve clients from all details of communicating with each other since they must register patterns and process incoming messages. Perhaps the biggest drawback of using it is that all communication among clients must be routed through a single process. As a result, the message server is unsuitable for clients that are distributed across slow networks or share state such as scrollbar and pointing device positions that change frequently. Message servers have been designed to support loosely-coupled processes communicating using a local area network.