Publish/subscribe overview

Publish/subscribe is a style of messaging application in which the providers of information (publishers) have no direct link to specific consumers of that information (subscribers), but the interactions between publishers and subscribers are controlled by pub/sub brokers.

In a publish/subscribe system, a publisher does not need to know who uses the information (publication) that it provides, and a subscriber does not need to know who provides the information that it receives as the result of a subscription. Publications are sent from publishers to the pub/sub broker, subscriptions are sent from subscribers to the pub/sub broker, and the pub/sub broker forwards the publications to the subscribers.

This style of messaging contrasts with a point-to-point style of messaging application, in which the application that sends messages needs to know the destinations of the messages that it sends.

The pub/sub broker ensures that messages are delivered to the correct subscribers. IBM® Integration Bus supports two types of pub/sub broker (MQTT and MQ), and you can choose which type to use based on your processing requirements and your existing architecture. A built-in MQTT broker is provided with IBM Integration Bus, and MQTT publication is enabled by default for all events that are generated by the integration node, apart from business events. You can specify an alternative MQTT broker if you choose not to use the built-in MQTT broker. If you have installed IBM MQ, you can use the MQ pub/sub broker that is provided with IBM MQ.

A typical publish/subscribe system has more than one publisher and more than one subscriber. An application can be both a publisher and a subscriber.

The publisher generates a message that it wants to publish and defines the topic of the message. A subscriber registers a request for a publication by specifying the topic (or topics) of the published messages that it is interested in. Subscriptions to an MQ pub/sub broker might include the following information:
  • The subscription point from which it wants to receive publications.
  • The content filter that should be applied to the published message.
  • The name of the queue (known as the subscriber queue) on which publications that match the criteria selected are placed. This queue can be a cluster queue, so that publications can be distributed to clustered subscribers.