Inquire Subscription
The Inquire Subscription (MQCMD_INQUIRE_SUBSCRIPTION) command inquires about the attributes of a subscription.
Required parameters
- SubName (MQCFST)
- The unique identifier of the 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 executed 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 executed on the queue manager on which it was entered.
- A queue manager name. The command is executed 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 executed 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 to filter on.
- 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_NO
- Information about nondurable subscriptions only is displayed.
- MQSUB_DURABLE_ALL
- Information about all subscriptions is displayed.
- SubscriptionAttrs (MQCFIL)
- Subscription attributes (parameter identifier: MQIACF_SUB_ATTRS).
Use one of the following parameters to select the attributes we want to display:
- ALL to display all attributes.
- SUMMARY to display a subset of the attributes (see MQIACF_SUMMARY for a list).
- Any of the following parameters individually or in combination.
- MQIACF_ALL
- All attributes.
- MQIACF_SUMMARY
- Use this parameter to display:
- MQBACF_DESTINATION_CORREL_ID
- MQBACF_SUB_ID
- MQCACF_DESTINATION
- MQCACF_DESTINATION_Q_MGR
- MQCACF_SUB_NAME
- MQCA_TOPIC_STRING
- MQIACF_SUB_TYPE
- MQBACF_ACCOUNTING_TOKEN
- The accounting token passed by the subscriber for propagation into messages sent to this subscription in the AccountingToken field of the MQMD.
- MQBACF_DESTINATION_CORREL_ID
- The CorrelId used for messages sent to this subscription.
- MQBACF_SUB_ID
- The internal unique key identifying a subscription.
- MQCA_ALTERATION_DATE
- The date of the most recent MQSUB with MQSO_ALTER or ALTER SUB command.
- MQCA_ALTERATION_TIME
- The time of the most recent MQSUB with MQSO_ALTER or ALTER SUB command.
- MQCA_CREATION_DATE
- The date of the first MQSUB command that caused this subscription to be created.
- MQCA_CREATION_TIME
- The time of the first MQSUB that caused this subscription to be created.
- MQCA_TOPIC_STRING
- The resolved topic string the subscription is for.
- MQCACF_APPL_IDENTITY_DATA
- The identity data passed by the subscriber for propagation into messages sent to this subscription in the ApplIdentity field of the MQMD.
- MQCACF_DESTINATION
- The destination for messages published to this subscription.
- MQCACF_DESTINATION_Q_MGR
- The destination queue manager for messages published to this subscription.
- MQCACF_SUB_NAME
- The unique identifier of an application for a subscription.
- MQCACF_SUB_SELECTOR
- The SQL 92 selector string to be applied to messages published on the named topic to select whether they are eligible for this subscription.
- MQCACF_SUB_USER_DATA
- The user data associated with the subscription.
- MQCACF_SUB_USER_ID
- The userid that owns the subscription. MQCACF_SUB_USER_ID is either the userid associated with the creator of the subscription, or, if subscription takeover is permitted, the userid which last took over the subscription.
- MQCA_TOPIC_NAME
- The name of the topic object that identifies a position in the topic hierarchy to which the topic string is concatenated.
- MQIACF_DESTINATION_CLASS
- Indicated whether this subscription is a managed subscription.
- MQIACF_DURABLE_SUBSCRIPTION
- Whether the subscription is durable, persisting over queue manager restart.
- MQIACF_EXPIRY
- The time to live from creation date and time.
- MQIACF_PUB_PRIORITY
- The priority of the messages sent to this subscription.
- MQIACF_PUBSUB_PROPERTIES
- The manner in which publish/subscribe related message properties are added to messages sent to this subscription.
- MQIACF_REQUEST_ONLY
- Indicates whether the subscriber polls for updates by using MQSUBRQ API, or whether all publications are delivered to this subscription.
- MQIACF_SUB_TYPE
- The type of subscription - how it was created.
- MQIACF_SUBSCRIPTION_SCOPE
- Whether the subscription forwards messages to all other queue managers directly connected by using a Publish/Subscribe collective or hierarchy, or the subscription forwards messages on this topic within this queue manager only.
- MQIACF_SUB_LEVEL
- The level within the subscription interception hierarchy at which this subscription is made.
- MQIACF_VARIABLE_USER_ID
- Users other than the creator of this subscription that can connect to it (subject to topic and destination authority checks).
- MQIACF_WILDCARD_SCHEMA
- The schema to be used when interpreting wildcard characters in the topic string.
- MQIA_DISPLAY_TYPE
- Controls the output returned in the TOPICSTR and TOPICOBJ attributes.
- 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 by way of the IBM MQ API 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.
- DisplayType (MQCFIN)
-
Controls the output returned in the MQCA_TOPIC_STRING and
MQCA_TOPIC_NAME attributes (parameter identifier: MQIA_DISPLAY_TYPE).
- MQDOPT_RESOLVED
- Returns the resolved (full) topic string in the MQCA_TOPIC_STRING attribute. The value of the MQCA_TOPIC_NAME attribute is also returned.
- MQDOPT_DEFINED
- Returns the values of the MQCA_TOPIC_NAME and MQCA_TOPIC_STRING attributes provided when the subscription was created. The MQCA_TOPIC_STRING attribute will contain the application part of the topic string only. We can use the values returned with MQCA_TOPIC_NAME and MQCA_TOPIC_STRING to fully re-create the subscription by using MQDOPT_DEFINED.
Parent topic: Definitions of the Programmable Command Formats