+

Search Tips | Advanced Search

Publications

Publications are messages that are sent by an application to the Publish/Subscribe Engine. The Publish/Subscribe Engine then sends the messages on to any applications that have subscribed to receive the messages.

The Publish/Subscribe Engine can handle publications that it receives in different ways, depending on the type of information contained in the publication.


State and event information

Publications can be categorized by the type of information that they contain:


Retained publications

By default, when the Publish/Subscribe Engine has sent a publication to all interested subscribers, the Publish/Subscribe Engine deletes the publication. This type of processing is suitable for event information but is not always suitable for state information. A publisher can specify that the Publish/Subscribe Engine must keep a copy of a publication, which is then called a retained publication. The copy can be sent to subsequent subscribers who register an interest in the topic. This means that new subscribers do not have to wait for information to be published again before they receive it. For example, a subscriber who registers a subscription to a stock price would receive the current stock price straightaway, without waiting for the stock price to change (and, therefore, be re-published).

The Publish/Subscribe Engine retains only one publication for each topic, so the old publication is deleted when a new one arrives. So, ensure that only one publisher is sending retained publications on each topic.

Subscribers can specify that they do not want to receive retained publications, and existing subscribers can ask for duplicate copies of retained publications to be sent to them.

For more information about how to decide whether to use retained publications, see Retained publications in the IBM MQ online product documentation.