+

Search Tips | Advanced Search

Subscribers and subscriptions

In IBM MQ publish/subscribe, a subscriber is an application that requests information about a specific topic from a queue manager in a publish/subscribe network. A subscriber can receive messages, about the same or different topics, from more than one publisher.

Subscriptions can be created manually using an MQSC command or by applications. These subscriptions are issued to the local queue manager and contain information about the publications the subscriber wants to receive:

The local queue manager stores subscription information and when it receives a publication, scans the information to determine whether there is a subscription that matches the publication's topic and selection string. For each matching subscription, the queue manager directs the publication to the subscriber's subscriber queue. The information that a queue manager stores about subscriptions can be viewed by using the DIS SUB and DIS SBSTATUS commands. A subscription is deleted only when one of the following events occurs:

When getting messages, use appropriate options on the MQGET call. If our application processes only messages for one subscription then, as a minimum, you should use get-by-correlid, as demonstrated in the C sample program amqssbxa.c and at unmanaged MQ subscriber. The CorrelId to use is returned from MQSUB in the MQSD.SubCorrelId field.