Defining an administrative subscription

Use the MQSC command DEFINE SUB to create an administrative subscription. We can also use the default defined in the default local subscription definition. Or, we can modify the subscription characteristics from those of the default local subscription, SYSTEM.DEFAULT.SUB that was created when the system was installed.

For example, the DEFINE SUB command that follows defines a subscription called ORANGE with these characteristics:

  • Durable subscription, meaning that it persists over queue manager restart, with unlimited expiry.
  • Receive publications made on the ORANGE topic string, with the message priorities as set by the publishing applications.
  • Publications delivered for this subscription are sent to the local queue SUBQ, this queue must be defined before the definition of the subscription.

DEFINE SUB (ORANGE) +
TOPICSTR (ORANGE) +
DESTCLAS (PROVIDED) +
DEST (SUBQ) +
EXPIRY (UNLIMITED) +
PUBPRTY (ASPUB)
Note:

  • The subscription and topic string name do not have to match.
  • Except for the values of the destination and topic string, all the attribute values shown are the default values. They are shown here only as an illustration. We can omit them if we are sure that the defaults are what we want or have not been changed. See also Display attributes of subscriptions.
  • If you already have a local subscription on the same queue manager with the name ORANGE, this command fails. Use the REPLACE attribute if we want to overwrite the existing definition of a queue, but see also Change local subscription attributes.
  • If the queue SUBQ does not exist, this command fails.

Parent topic: Work with subscriptions


Related information