Managing Durable Subscriptions

Message Queue clients subscribing to a topic destination can register
as durable subscribers. The corresponding durable subscription
has a unique, persistent identity and requires the broker to retain messages
addressed to it even when its message consumer (the durable subscriber) becomes
inactive. Ordinarily, the broker may delete a message held for a durable subscriber
only when the message expires.

The Message Queue Command utility provides subcommands for managing
a broker’s durable subscriptions in the following ways:

Listing durable subscriptions

Purging all messages for a durable subscription

Destroying a durable subscription

To list durable subscriptions for a specified physical destination,
use the imqcmdlistdur subcommand:

imqcmd list dur -dtopicName

For example, the following command lists all durable subscriptions to
the topic SPQuotes on the default broker (host localhost at port 7676):

imqcmd list dur -d SPQuotes

The resulting output lists the name of each durable subscription to
the topic, the client identifier to which it belongs, its current state (active
or inactive), and the number of messages currently queued to it. Example 7–6 shows an example.