Publishers and subscribers

Publishers and subscribers are applications that send and receive messages (publications) using the publish/subscribe method of messaging. Publishers and subscribers are decoupled from one another so that publishers do not know the destination of the information that they send, and subscribers do not know the source of the information that they receive.

The provider of the information is called a publisher. Publishers supply information about a subject without needing to know anything about the applications that are interested in the information.

The consumer of the information is called a subscriber. The subscriber decides what information it is interested in, and then waits to receive that information. Subscribers can receive information from many different publishers, and the information they receive can also be sent to other subscribers.

The information is sent in a WebSphere® MQ message, and the subject of the information is identified by a topic string. The publisher specifies the topic string when it publishes the information, and the subscriber specifies the topic strings on which it wants to receive publications. The subscriber is sent information about only those topic strings to which it subscribes.

On WebSphere MQ V6 queue managers, interactions between publishers and subscribers are all controlled by a broker. The broker receives messages from publishers, and subscription requests from subscribers. The broker's job is to route the published data to the target subscribers.

WebSphere MQ V7 queue managers use a Pub/Sub Engine instead of a broker to control the interactions between publishers and subscribers. The Pub/Sub Engine receives messages from publishers, and subscription requests from subscribers. The Pub/Sub Engine's job is to route the published data to the target subscribers.

On WebSphere MQ V6 queue managers, related topics can be grouped together to form a stream. Publishers can choose to use streams, for example, to restrict the range of publications and subscriptions that a broker has to support, or to provide access control. The broker has a default stream that is used for all topics that do not belong to another stream.