4.3 PUBLISH/SUBSCRIBE

The requirements of a communications infrastructure presented in the previous section are addressed by the publish/subscribe model. The publish/subscribe model provides a simple yet powerful abstraction for application interactions. Below, we present the publish/subscribe model, briefly outline its benefits, and describe a distributed implementation of this model.

4.3.1 Publish/Subscribe Model

Publish/subscribe is a data-dissemination model that has many useful properties. There are three main entities in the publish/subscribe model: the publisher, subscriber, and broker. The publisher is the data producer, the subscriber the data consumer, and the broker mediates between the publisher and subscriber. These entities are only logical and do not have to correspond to physical components. For example, it is possible for a computer to be a publisher, subscriber, and broker.

A popular example of the publish/subscribe model is a stock quote information dissemination application. In this example, the publisher would be the stock exchange, such as the New York Stock Exchange, and the consumer could be a stock broker who is interested in tracking the latest prices of certain stocks. A subscriber S expresses his interest in these stocks by sending a subscription message s to the broker. The broker stores these subscriptions in an index T as a set of (subscription, subscriber) tuples. The publisher P communicates the latest stock updates by sending a publication message ...

Get Mobile Intelligence now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.