SubName (MQCHARV)
This specifies the subscription name. This field is only required if Options specifies the option MQSO_DURABLE, but if provided will be used by the queue manager for MQSO_NON_DURABLE as well.
If specified, SubName must be unique within the queue manager, because it is the method used to identify the subscription.
The maximum length of SubName is 10240.
This field serves two purposes. For an MQSO_DURABLE subscription, we use this field to identify a subscription so we can resume it after it has been created if you have either closed the handle to the subscription (using the MQCO_KEEP_SUB option) or have been disconnected from the queue manager. This is done using the MQSUB call with the MQSO_RESUME option. It is also displayed in the administrative view of subscriptions in the SUBNAME field in DISPLAY SBSTATUS.
If SubName is specified incorrectly, according to the description of how to use the MQCHARV structure, is left out when it is required (that is SubName. VSLength is zero), or if it exceeds the maximum length, the call fails with reason code MQRC_SUB_NAME_ERROR.
This is an input field. The initial values of the fields in this structure are the same as those in the MQCHARV structure.
If altering an existing subscription using the MQSO_ALTER option, the subscription name cannot be changed, because it is the identifying field used to find the referenced subscription. It is not changed on output from an MQSUB call with the MQSO_RESUME option.
Parent topic: Fields for MQSD