Inquire Subscription Status
The Inquire Subscription Status (MQCMD_INQUIRE_SUB_STATUS) command inquires about the status of a subscription.
Required parameters
- SubName (MQCFST)
- The unique identifier of an application for a subscription (parameter identifier:
MQCACF_SUB_NAME).
If SubName is not provided, SubId must be specified to identify the subscription to be inquired.
The maximum length of the string is MQ_SUB_NAME_LENGTH.
- SubId (MQCFBS)
- Subscription identifier (parameter identifier: MQBACF_SUB_ID).
Specifies the unique internal subscription identifier. If the queue manager is generating the CorrelId for a subscription, then the SubId is used as the DestinationCorrelId.
We must supply a value for SubId if you have not supplied a value for SubName.
The maximum length of the string is MQ_CORREL_ID_LENGTH.
Optional parameters
- CommandScope (MQCFST)
- Command scope (parameter identifier: MQCACF_COMMAND_SCOPE). This parameter applies to z/OS only.
Specifies how the command is processed when the queue manager is a member of a queue sharing group. We can specify one of the following:
- Blank (or omit the parameter altogether). The command is processed on the queue manager on which it was entered.
- A queue manager name. The command is processed on the queue manager you specify, providing it is active within the queue sharing group. If you specify a queue manager name other than the queue manager on which it was entered, we must be using a queue sharing group environment, and the command server must be enabled.
- An asterisk (*). The command is processed on the local queue manager and is also passed to every active queue manager in the queue sharing group.
The maximum length is MQ_QSG_NAME_LENGTH.
We cannot use CommandScope as a parameter on which to filter.
- Durable (MQCFIN)
- Specify this attribute to restrict the type of subscriptions which are displayed (parameter
identifier: MQIACF_DURABLE_SUBSCRIPTION).
- MQSUB_DURABLE_YES
- Information about durable subscriptions only is displayed. MQSUB_DURABLE_YES is the default.
- MQSUB_DURABLE_NO
- Information about non-durable subscriptions only is displayed.
- SubscriptionType (MQCFIN)
- Specify this attribute to restrict the type of subscriptions which are displayed (parameter
identifier: MQIACF_SUB_TYPE).
- MQSUBTYPE_ADMIN
- Subscriptions which have been created by an admin interface or modified by an admin interface are selected.
- MQSUBTYPE_ALL
- All subscription types are displayed.
- MQSUBTYPE_API
- Subscriptions created by applications through an IBM MQ API call are displayed.
- MQSUBTYPE_PROXY
- System created subscriptions relating to inter-queue manager subscriptions are displayed.
- MQSUBTYPE_USER
- USER subscriptions (with SUBTYPE of either ADMIN or API) are displayed. MQSUBTYPE_USER is the default value.
- StatusAttrs (MQCFIL)
- Subscription status attributes (parameter identifier: MQIACF_SUB_STATUS_ATTRS). To select the
attributes we want to display we can specify;
- ALL to display all attributes.
- any of the following parameters individually or in combination.
- MQIACF_ALL
- All attributes.
- MQBACF_CONNECTION_ID
- The currently active ConnectionID that has opened the subscription.
- MQIACF_DURABLE_SUBSCRIPTION
- Whether the subscription is durable, persisting over queue manager restart.
- MQCACF_LAST_MSG_DATE
- The date that a message was last sent to the destination specified by the subscription.
- MQCACF_LAST_MSG_TIME
- The time when a message was last sent to the destination specified by the subscription.
- MQIACF_MESSAGE_COUNT
- The number of messages put to the destination specified by the subscription.
- MQCA_RESUME_DATE
- The date of the most recent MQSUB command that connected to the subscription.
- MQCA_RESUME_TIME
- The time of the most recent MQSUB command that connected to the subscription.
- MQIACF_SUB_TYPE
- The type of subscription - how it was created.
- MQCACF_SUB_USER_ID
- The userid owns the subscription.
- MQCA_TOPIC_STRING
- Returns the fully resolved topic string of the subscription.
Parent topic: Definitions of the Programmable Command Formats