Field details for MQSD
The MQSD Subscription descriptor structure is used to specify details about the subscription being made. The structure is an input/output parameter on the MQSUB call.
StrucId (MQCHAR4)
This is the structure identifier of the subscription descriptor structure. It is always an input field. Its value is MQSD_STRUC_ID.
- MQSD_STRUC_ID
- Identifier for the subscription descriptor structure.
For the C programming language, the constant MQSD_STRUC_ID_ARRAY is also defined. This has the same value as MQSD_STRUC_ID, but is an array of characters instead of a string.
Version (MQLONG)
- MQSD_VERSION_1
- Version-1 Subscription Descriptor structure.
- MQSD_CURRENT_VERSION
- Current version of Subscription Descriptor structure.
This is always an input field. The initial value of this field is MQSD_VERSION_1.
Options (MQLONG)
This provides options to control the action of the MQSUB call.
- MQSO_ALTER
- MQSO_RESUME
- MQSO_CREATE
Combinations that are not valid are noted in this topic; any other combinations are valid.
Access or creation options: Access and creation options control whether a subscription is created, or whether an existing subscription is returned or altered. You must specify at least one of these options.
| Combination of options | Notes |
|---|---|
| MQSO_CREATE | Creates a subscription if one does not exist. This combination fails if the subscription exists. |
| MQSO_RESUME | Resumes an existing subscription. This combination fails if no subscription exists. |
| MQSO_CREATE + MQSO_RESUME | Creates a subscription if one does not exist and resumes a matching one, if it does exist. This combination is useful when it is used in an application that is run a number of times. |
| MQSO_ALTER (see note) | Resumes an existing subscription, altering any fields to match that specified in the MQSD. This combination fails if no subscription exists. |
| MQSO_CREATE + MQSO_ALTER (see note) | Creates a subscription if one does not exist and resumes a matching one, if it does exist, altering any fields to match that specified in the MQSD. This combination is useful combination when used in an application that wants to ensure that its subscription is in a certain state before proceeding. |
Options specifying MQSO_ALTER can also specify MQSO_RESUME, but this combination has no additional effect to specifying MQSO_ALTER alone. MQSO_ALTER implies MQSO_RESUME, because calling MQSUB to alter a subscription implies that the subscription will also be resumed. The opposite is not true, however: resuming a subscription does not imply it is to be altered.
- MQSO_CREATE
-
Create a new subscription for the topic specified. If a subscription using the same
SubNameexists, the call fails with MQRC_SUB_ALREADY_EXISTS. This failure can be avoided by combining the MQSO_CREATE option with MQSO_RESUME. TheSubNameis not always necessary. For more details, see the description of that field.Combining MQSO_CREATE with MQSO_RESUME returns a handle to a pre-existing subscription for the specified
SubNameif one is found; if there is no existing subscription, a new one is created using all the fields provided in the MQSD.MQSO_CREATE can also be combined with MQSO_ALTER to similar effect.
- MQSO_RESUME
-
Return a handle to a pre-existing subscription which matches that specified by
SubName. No changes are made to the matching subscriptions attributes and they are returned on output in the MQSD structure. Only the following MQSD fields are used: StrucId, Version, Options, AlternateUserId and AlternateSecurityId, and SubName.The call fails with reason code MQRC_NO_SUBSCRIPTION if a subscription does not exist matching the full subscription name. This failure can be avoided by combining the MQSO_CREATE option with MQSO_RESUME.
The user ID of the subscription is the user ID that created the subscription, or if it has been later altered by a different user ID, it is the user ID of the most recent successful alteration. If an AlternateUserId is used, and use of alternate user IDs is allowed for that user, the alternate user ID is recorded as the user ID that created the subscription instead of the user ID under which the subscription was made.
If a matching subscription exists that was created without the MQSO_ANY_USERID option, and the user ID of the subscription is different from that of the application requesting a handle to the subscription, the call fails with reason code MQRC_IDENTITY_MISMATCH.
If a matching subscription exists and is currently in use, the call fails with MQRC_SUBSCRIPTION_IN_USE.
If the subscription named in SubName is not a valid subscription to resume or alter from an application, the call fails with MQRC_INVALID_SUBSCRIPTION.
MQSO_RESUME is implied by MQSO_ALTER so you do not need to combine it with that option. However, combining the two options does not cause an error.
- MQSO_ALTER
-
Return a handle to a pre-existing subscription with the full subscription name matching that specified by the name in
SubName. Any attributes of the subscription that are different from that specified in the MQSD are altered in the subscription unless alteration is disallowed for that attribute. Details are noted in the description of each attribute and are summarized in the following table. If you try to alter an attribute that cannot be changed, or to alter a subscription that has set the MQSO_IMMUTABLE option, the call fails with the reason code shown in the following table.The call fails with reason code MQRC_NO_SUBSCRIPTION if a subscription matching the full subscription name does not exist. You can avoid this failure by combining the MQSO_CREATE option with MQSO_ALTER.
Combining MQSO_CREATE with MQSO_ALTER returns a handle to a pre-existing subscription for the specified
SubNameif one is found; if there is no existing subscription, a new one is created using all the fields provided in the MQSD.The user ID of the subscription is the user ID that created the subscription, or if it is later altered by a different user ID, it is the user ID of the most recent, successful alteration. If an AlternateUserId is used, and use of alternate user IDs is allowed for that user, then the alternate user ID is recorded as the user ID that created the subscription instead of the user ID under which the subscription was made.
If a matching subscription exists that was created without the option MQSO_ANY_USERID and the user ID of the subscription is different from that of the application requesting a handle to the subscription, the call fails with reason code MQRC_IDENTITY_MISMATCH.
If a matching subscription exists and is currently in use, the call fails with MQRC_SUBSCRIPTION_IN_USE.
If the subscription named in SubName is not a valid subscription to resume or alter from an application, the call fails with MQRC_INVALID_SUBSCRIPTION.
The following table shows the ability of MQSO_ALTER to alter attribute values in MQSD and MQSUB.
| Data type descriptor or function call | Field name | Can this attribute be altered using MQSO_ALTER | Reason code |
|---|---|---|---|
| MQSD | Durability options | No | MQRC_DURABILITY_NOT_ALTERABLE |
| MQSD | Destination Options | Yes | None |
| MQSD | Registration options | Yes (see note 1) | MQRC_GROUPING_NOT_ALTERABLE if you try to alter MQSO_GROUP_SUB |
| MQSD | Publication options | Yes (see note 2) | None |
| MQSD | Wildcard options | No | MQRC_TOPIC_NOT_ALTERABLE |
| MQSD | Other options | No (see note 3) | None |
| MQSD | ObjectName | No | MQRC_TOPIC_NOT_ALTERABLE |
| MQSD | AlternateUserId | No (see note 4) | None |
| MQSD | AlternateSecurityId | No (see note 4) | None |
| MQSD | SubExpiry | Yes | None |
| MQSD | ObjectString | No | MQRC_TOPIC_NOT_ALTERABLE |
| MQSD | SubName | No (see note 5 ) | None |
| MQSD | SubUserData | Yes | None |
| MQSD | SubCorrelId | Yes (see note 6) | MQRC_GROUPING_NOT_ALTERABLE when in a grouped subscription |
| MQSD | PubPriority | Yes | None |
| MQSD | PubAccountingToken | Yes | None |
| MQSD | PubApplIdentityData | Yes | None |
| MQSD | SubLevel | No | MQRC_SUBLEVEL_NOT_ALTERABLE |
| MQSUB | Hobj | Yes (see note 6) | MQRC_GROUPING_NOT_ALTERABLE when in a grouped subscription |
- MQSO_GROUP_SUB cannot be altered.
- MQSO_NEW_PUBLICATIONS_ONLY cannot be altered because it is not part of the subscription
- These options are not part of the subscription
- This attribute is not part of the subscription
- This attribute is the identity of the subscription being altered
- Alterable except when part of a grouped sub (MQSO_GROUP_SUB)
Durability options
The following options control how durable the subscription is. You can specify only one of these options. If you are altering an existing subscription using the MQSO_ALTER option, you cannot change the durability of the subscription. On return from an MQSUB call using MQSO_RESUME, the appropriate durability option is set.
- MQSO_DURABLE
- Request that the subscription to this topic remains until it is explicitly removed using MQCLOSE with the MQCO_REMOVE_SUB option. If this subscription is not explicitly removed it will remain even after this applications connection to the queue manager is closed.
- MQSO_NON_DURABLE
- Request that the subscription to this topic is removed when the applications connection to the queue manager is closed, if it is not already explicitly removed. MQSO_NON_DURABLE is the opposite of the MQSO_DURABLE option, and is defined to aid program documentation. It is the default if neither is specified.
Destination options
The following option controls the destination that publications for a topic that has been subscribed to are sent to. If altering an existing subscription using the MQSO_ALTER option, the destination used for publications for the subscription can be changed. On return from an MQSUB call using MQSO_RESUME, this option is set if appropriate.
- MQSO_MANAGED
-
Request that the destination that the publications are sent to is managed by the queue manager.
The object handle returned in
Hobjrepresents a queue manager managed queue and is for use with subsequent MQGET, MQCB, MQINQ, or MQCLOSE calls.An object handle returned from a previous MQSUB call cannot be provided in the Hobj parameter when MQSO_MANAGED is not specified.
- MQSO_NO_MULTICAST
-
Request that the destination that the publications are sent to is not a multicast group address. This option is only valid when combined with the MQSO_MANAGED option. When a handle to a queue is provided in the Hobj parameter, multicast cannot be used for this subscription, and the option is not valid.
If the topic is defined to only allow multicast subscriptions, using the
MCAST(ONLY)setting, then the call fails with reason code MQRC_MULTICAST_REQUIRED.
Scope Option
The following option controls the scope of the subscription being made. If altering an existing subscription using the MQSO_ALTER option, this subscription scope option cannot be changed. On returning from an MQSUB call using MQSO-RESUME, the appropriate scope option is set.
- MQSO_SCOPE_QMGR
- This subscription is made only on the local queue manager. No proxy subscription is distributed
to other queue managers in the network. Only publications that are published at this queue manager
are sent to this subscriber. This overrides any behavior set using the SUBSCOPE topic attribute.
Note: If not set, the subscription scope is determined by the SUBSCOPE topic attribute.
Registration options
The following options control the details of the registration that is made to the queue manager for this subscription. If altering an existing subscription using the MQSO_ALTER option, these registration options can be changed. On return from an MQSUB call using MQSO_RESUME the appropriate registration options is set.
- MQSO_GROUP_SUB
-
This subscription is to be grouped with other subscriptions of the same SubLevel using the same queue and specifying the same correlation ID so that any publications to topics that would cause more than one publication message to be provided to the group of subscriptions, due to an overlapping set of topic strings being used, only causes one message to be delivered to the queue. If this option is not used, then each unique subscription (identified by SubName) that matches is provided with a copy of the publication which could mean more than one copy of the publication may be placed on the queue shared by a number of subscriptions.
Only the most significant subscription in the group is provided with a copy of the publication. The most significant subscription is based on the Full topic name up to the point where a wildcard is found. If a mixture of wildcard schemes is used within the group, only the position of the wildcard is important. You are advised not to combine different wildcard schemes within a group of subscriptions that share the same queue.
When creating a new grouped subscription it must still have a unique SubName, but if it matches the full topic name of an existing subscription in the group, the call fails with MQRC_DUPLICATE_GROUP_SUB.
If the most significant subscription in group also specifies MQSO_NOT_OWN_PUBS and this is a publication from the same application, then no publication is delivered to the queue.
When altering a subscription made with this option, the fields which imply the grouping, Hobj on the MQSUB call (representing the queue and queue manager name), and the SubCorrelId cannot be changed. Attempting to alter them causes the call to fail with MQRC_GROUPING_NOT_ALTERABLE.
This option must be combined with MQSO_SET_CORREL_ID with a SubCorrelId that is not set to MQCI_NONE, and cannot be combined with MQSO_MANAGED.
- MQSO_ANY_USERID
-
When MQSO_ANY_USERID is specified, the identity of the subscriber is not restricted to a single user ID. This allows any user to alter or resume the subscription when they have suitable authority. Only a single user may have the subscription at any one time. An attempt to resume use of a subscription currently in use by another application causes the call to fail with MQRC_SUBSCRIPTION_IN_USE.
To add this option to an existing subscription the MQSUB call (using MQSO_ALTER) must come from the same user ID as the original subscription itself.
If an MQSUB call refers to an existing subscription with MQSO_ANY_USERID set, and the user ID differs from the original subscription, the call succeeds only if the new user ID has authority to subscribe to the topic. On successful completion, future publications to this subscriber are put to the subscribers queue with the new user ID set in the publication message.
Do not specify both MQSO_ANY_USERID and MQSO_FIXED_USERID. If neither is specified, the default is MQSO_FIXED_USERID.
- MQSO_FIXED_USERID
-
When MQSO_FIXED_USERID is specified, the subscription can be altered or resumed by only the last user ID to alter the subscription. If the subscription has not been altered, it is the user ID that created the subscription.
If an MQSUB verb refers to an existing subscription with MQSO_ANY_USERID set and alters the subscription using MQSO_ALTER to use option MQSO_FIXED_USERID, the user ID of the subscription is now fixed at this new user ID. The call succeeds only if the new user ID has authority to subscribe to the topic.
If a user ID other than the one recorded as owning a subscription tries to resume or alter an MQSO_FIXED_USERID subscription, the call fails with MQRC_IDENTITY_MISMATCH. The owning user ID of a subscription can be viewed using the DISPLAY SBSTATUS command.
Do not specify both MQSO_ANY_USERID and MQSO_FIXED_USERID. If neither is specified, the default is MQSO_FIXED_USERID.
Publication options
The following options control the way publications are sent to this subscriber. If altering an existing subscription using the MQSO_ALTER option, these publication options can be changed.
- MQSO_NOT_OWN_PUBS
- Tells the broker that the application does not want to see any of its own publications. Publications are considered to originate from the same application if the connection handles are the same. On return from an MQSUB call using MQSO_RESUME, this option is set if appropriate.
- MQSO_NEW_PUBLICATIONS_ONLY
- No currently retained publications are to be sent, when this subscription is created, only new publications. This option only applies when MQSO_CREATE is specified. Any subsequent changes to a subscription do not alter the flow of publications and so any publications retained on a topic, will have already been sent to the subscriber as new publications.
- MQSO_PUBLICATIONS_ON_REQUEST
- Setting this option indicates that the subscriber will request information specifically when required. The queue manager does not send unsolicited messages to the subscriber. The retained publication (or possibly multiple publications if a wildcard is specified in the topic) is sent to the subscriber each time an MQSUBRQ call is made using the Hsub handle from a previous MQSUB call. No publications are sent as a result of the MQSUB call using this option. On return from an MQSUB call using MQSO_RESUME, this option is set if appropriate.
Read ahead options
The following options control whether non-persistent messages are sent to an application ahead of the application requesting them.
- MQSO_READ_AHEAD_AS_Q_DEF
- If the MQSUB call uses a managed handle, the default read ahead attribute of the model queue associated with the topic subscribed to determines whether messages are sent to the application before the application requests them.
- MQSO_NO_READ_AHEAD
- If the MQSUB call uses a managed handle, messages are not sent to the application before the application requests them.
- MQSO_READ_AHEAD
- If the MQSUB call uses a managed handle, messages might be sent to the application before the application requests them.
- Only one of these options can be specified. If both MQOO_READ_AHEAD and MQOO_NO_READ_AHEAD are specified, reason code MQRC_OPTIONS_ERROR is returned. These options are only applicable if MQSO_MANAGED is specified.
- They are not applicable for MQSUB when a queue is passed which has been opened previously. Read ahead might not be enabled when requested. The MQGET options used on the first MQGET call might prevent read ahead from being enabled. Also, read ahead is disabled when the client is connecting to a queue manager where read ahead is not supported. If the application is not running as an IBM® MQ client, these options are ignored.
Wildcard options
The following options control how wildcards are interpreted in the string provided in the ObjectString field of the MQSD. You can specify only one of these options. If altering an existing subscription using the MQSO_ALTER option, these wildcard options cannot be changed. On return from an MQSUB call using MQSO_RESUME, the appropriate wildcard option is set.
- MQSO_WILDCARD_CHAR
- Wildcards only operate on characters within the topic string.
- MQSO_WILDCARD_TOPIC
-
Wildcards only operate on topic elements within the topic string. This is the default behavior if none is chosen.
The behavior required by MQSO_WILDCARD_TOPIC is shown in the following table:Table 4. How wildcards are interpreted Special Character Behavior (/) Topic level separator Number sign (#) Wildcard: multiple topic level Plus sign (+) Wildcard: single topic level Notes:The (+) and (#) are not treated as wildcards if they are mixed in with other characters (including themselves) within a topic level. In the following string, the (#) and (+) characters are treated as ordinary characters.level0/level1/#+/level3/level#For example, publishing on the following topic:
matches subscribers using the following topics:/level0/level1/level2/level3/level4# /# / level0/level1/level2/level3/# / level0/level1/+/level3/level4
Other options
The following options control the way the API call is issued rather than the subscription. On return from an MQSUB call using MQSO_RESUME, these options are unchanged. See AlternateUserId (MQCHAR12) for more details.
- MQSO_ALTERNATE_USER_AUTHORITY
-
The AlternateUserId field contains a user identifier to use to validate this MQSUB call. The call can succeed only if this AlternateUserId is authorized to open the object with the specified access options, regardless of whether the user identifier under which the application is running is authorized to do so.
- MQSO_SET_CORREL_ID
-
The subscription is to use the correlation identifier supplied in the
SubCorrelIdfield. If this option is not specified, a correlation identifier is automatically created by the queue manager at subscription time and is returned to the application in theSubCorrelIdfield. For more information, see SubCorrelId for more information.This option cannot be combined with MQSO_MANAGED.
- MQSO_SET_IDENTITY_CONTEXT
-
The subscription is to use the accounting token and application identity data supplied in the
PubAccountingTokenandPubApplIdentityDatafields.If this option is specified, the same authorization check is carried out as if the destination queue was accessed using an MQOPEN call with MQOO_SET_IDENTITY_CONTEXT, except in the case where the MQSO_MANAGED option is also used in which case there is no authorization check on the destination queue.
If this option is not specified, the publications sent to this subscriber have default context information associated with them as follows:Table 5. Default context information for publications sent to this subscriber Field in MQMD Value used UserIdentifierThe user ID associated with the subscription at the time the subscription was made. AccountingTokenDetermined from the environment if possible; Set to MQACT_NONE if not. ApplIdentityDataSet to blanks This option is only valid with MQSO_CREATE and MQSO_ALTER. If used with MQSO_RESUME, the
PubAccountingTokenandPubApplIdentityDatafields are ignored, so this option has no effect.If a subscription is altered without using this option where previously the subscription supplied identity context information, default context information is generated for the altered subscription.
If a subscription allowing different user IDs to use it with option MQSO_ANY_USERID, is resumed by a different user ID, default identity context is generated for the new user ID now owning the subscription and any subsequent publications are delivered containing the new identity context.
- MQSO_FAIL_IF_QUIESCING
-
The MQSUB call fails if the queue manager is in quiescing state. On z/OS®, for a CICS® or IMS application, this option also forces the MQSUB call to fail if the connection is in quiescing state.
ObjectName (MQCHAR48)
This is the name of the topic object as defined on the local queue manager.
- Uppercase alphabetic characters (A through Z)
- Lowercase alphabetic characters (a through z)
- Numeric digits (0 through 9)
- Period (.), forward slash (/), underscore (_), percent (%)
- On systems that use EBCDIC Katakana, lowercase characters cannot be used.
- On z/OS:
- Avoid names that begin or end with an underscore; they cannot be processed by the operations and control panels.
- The percent character has a special meaning to RACF®. If RACF is used as the external security manager, names must not contain the percent. If they do, those names are not included in any security checks when RACF generic profiles are used.
- On IBM i, names containing lowercase characters, forward slash, or percent, must be enclosed in quotation marks when specified on commands. These quotation marks must not be specified for names that occur as fields in structures or as parameters on calls.
The ObjectName is used to form the full topic name.
The full topic name can be built from two different fields:
ObjectName and ObjectString.
For details of how these two fields are used, see Combining topic strings.
If the object identified by the ObjectName field cannot be
found, the call fails with reason code MQRC_UNKNOWN_OBJECT_NAME even if there is a string specified
in ObjectString.
On return from an MQSUB call using the MQSO_RESUME option this field is unchanged.
The length of this field is given by MQ_TOPIC_NAME_LENGTH. The initial value of this field is the null string in C, and 48 blank characters in other programming languages.
If altering an existing subscription using the MQSO_ALTER option, the name of the topic object
subscribed to cannot be changed. This field and the ObjectString
field can be omitted. If they are provided, they must resolve to the same full topic name. If they
do not, the call fails with MQRC_TOPIC_NOT_ALTERABLE.
AlternateUserId (MQCHAR12)
If you specify MQSO_ALTERNATE_USER_AUTHORITY, this field contains an alternative user identifier that is used to check the authorization for the subscription and for output to the destination queue (specified in the Hobj parameter of the MQSUB call), in place of the user identifier that the application is currently running under.
If successful, the user identifier specified in this field is recorded as the subscription owning user identifier in place of the user identifier that the application is currently running under.
If MQSO_ALTERNATE_USER_AUTHORITY is specified and this field is entirely blank up to the first null character or the end of the field, the subscription can succeed only if no user authorization is needed to subscribe to this topic with the options specified or the destination queue for output.
If MQSO_ALTERNATE_USER_AUTHORITY is not specified, this field is ignored.
- On z/OS, only the first 8 characters of AlternateUserId are used to check the authorization for the subscription. However, the current user identifier must be authorized to specify this particular alternative user identifier; all 12 characters of the alternative user identifier are used for this check. The user identifier must contain only characters allowed by the external security manager.
On return from an MQSUB call using MQSO_RESUME, this field is unchanged.
This is an input field. The length of this field is given by MQ_USER_ID_LENGTH. The initial value of this field is the null string in C, and 12 blank characters in other programming languages.
AlternateSecurityId (MQBYTE40)
This is a security identifier that is passed with the AlternateUserId to the authorization service to allow appropriate authorization checks to be performed.
AlternateSecurityId is used only if MQSO_ALTERNATE_USER_AUTHORITY is specified, and the AlternateUserId field is not entirely blank up to the first null character or the end of the field.
On return from an MQSUB call using MQSO_RESUME, this field is unchanged.
See the description of AlternateSecurityId (MQBYTE40) in the MQOD data type for more information.
SubExpiry (MQLONG)
This is the time expressed in tenths of a second after which the subscription expires. No more
publications will match this subscription after this interval has passed. As soon as a subscription
expires, publications are no longer sent to the queue. However, the publications that are already
there are not affected in any way. SubExpiry has no effect on
publication expiry.
- MQEI_UNLIMITED
- The subscription has an unlimited expiration time.
If altering an existing subscription using the MQSO_ALTER option, the expiry of the subscription can be changed.
On return from an MQSUB call using the MQSO_RESUME option this field is set to the original expiry of the subscription and not the remaining expiry time.
ObjectString (MQCHARV)
This is the long object name to be used.
The ObjectString is used to form the Full topic name.
The full topic name can be built from two different fields:
ObjectName and ObjectString.
For details of how these two fields are used, see Combining topic strings.
The maximum length of ObjectString is 10240.
If ObjectString is not specified correctly, according to the
description of how to use the MQCHARV structure, or if it exceeds
the maximum length, the call fails with reason code MQRC_OBJECT_STRING_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 there are wildcards in the ObjectString the interpretation
of those wildcards can be controlled using the Wildcard options specified in the Options field of
the MQSD.
On return from an MQSUB call using the MQSO_RESUME option this field is unchanged. The full topic
name used is returned in the ResObjectString field if a buffer
is provided.
If altering an existing subscription using the MQSO_ALTER option, the long name of the topic
object subscribed to cannot be changed. This field and the
ObjectName field can be omitted. If they are provided they must
resolve to the same full topic name or the call fails with MQRC_TOPIC_NOT_ALTERABLE.
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, you use this field to identify a subscription so you 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 SUBID 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.
SubUserData (MQCHARV)
This specifies the subscription user data. The data provided on the subscription in this field will be included as the MQSubUserData message property of every publication sent to this subscription.
The maximum length of SubUserData is 10240.
If SubUserData is specified incorrectly, according to the
description of how to use the MQCHARV structure, or if it exceeds
the maximum length, the call fails with reason code MQRC_SUB_USER_DATA_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 user data can be changed.
This variable length field is returned on output from an MQSUB call using the MQSO_RESUME option,
if a buffer is provided and there is a positive buffer length in
VSBufLen. If no buffer is provided on the call, only the length
of the subscription user date is returned in the VSLength field
of the MQCHARV. If the buffer provided is smaller than the space required to return the field, only
VSBufLen bytes are returned in the provided buffer.
SubCorrelId (MQBYTE24)
This field contains a correlation identifier common to all publications matching this subscription.
All publications sent to match this subscription contain this correlation identifier in the message descriptor. If multiple subscriptions get their publications from the same queue, using MQGET by correlation identifier allows only publications for a specific subscription to be obtained. This correlation identifier can either be generated by the queue manager or by the user.
If the option MQSO_SET_CORREL_ID is not specified, the correlation identifier is generated by the queue manager and this field is an output field containing the correlation identifier that will be set in each message published for this subscription. The generated correlation identifier consists of a 4-byte product identifier (AMQX or CSQM in either ASCII or EBCDIC) followed by a product specific implementation of a unique string.
If the option MQSO_SET_CORREL_ID is specified, the correlation identifier is generated by the user and this field is an input field containing the correlation identifier to be set in each publication for this subscription. In this case, if the field contains MQCI_NONE, the correlation identifier that is set in each message published for this subscription is the correlation identifier created by the original put of the message.
If the option MQSO_GROUP_SUB is specified and the correlation identifier specified is the same as an existing grouped subscription using the same queue and an overlapping topic string, only the most significant subscription in the group is provided with a copy of the publication.
The length of this field is given by MQ_CORREL_ID_LENGTH. The initial value of this field is MQCI_NONE.
If you are altering an existing subscription using the MQSO_ALTER option, and this field is an input field, then the subscription correlation identifier can be changed, unless the subscription is a grouped subscription, that is, it has been created using the option MQSO_GROUP_SUB, in which case the subscription correlation identifier cannot be changed.
On return from an MQSUB call using MQSO_RESUME, this field is set to the current correlation identifier for the subscription.
PubPriority (MQLONG)
This is the value that will be in the Priority field of the
Message Descriptor (MQMD) of all publication messages matching this subscription. For more
information about the Priority field in the MQMD, see Priority (MQLONG).
- MQPRI_PRIORITY_AS_Q_DEF
-
When a subscription queue is provided in the
Hobjfield in the MQSUB call, and is not a managed handle, then the priority for the message is taken from the DefPriority attribute of this queue. If the queue is a cluster queue or there is more than one definition in the queue-name resolution path then the priority is determined when the publication message is put to the queue as described for Priority (MQLONG).If the MQSUB call uses a managed handle, the priority for the message is taken from the DefPriority attribute of the model queue associated with the topic subscribed to.
- MQPRI_PRIORITY_AS_PUBLISHED
-
The priority for the message is the priority of the original publication. This is the initial value of the field.
If altering an existing subscription using the MQSO_ALTER option, the
Priority of any future publication messages can be changed.
On return from an MQSUB call using MQSO_RESUME, this field is set to the current priority being used for the subscription.
PubAccountingToken (MQBYTE32)
This is the value that will be in the AccountingToken field
of the Message Descriptor (MQMD) of all publication messages matching this subscription.
AccountingToken is part of the identity context of the message.
For more information about message context, see Message context. For more information about the
AccountingToken field in the MQMD, see AccountingToken (MQBYTE32)
PubAccountingToken field:- MQACT_NONE
-
No accounting token is specified.
The value is binary zero for the length of the field.
For the C programming language, the constant MQACT_NONE_ARRAY is also defined; this has the same value as MQACT_NONE, but is an array of characters instead of a string.
If the option MQSO_SET_IDENTITY_CONTEXT is not specified, the accounting token is generated by
the queue manager as default context information and this field is an output field which contains
the AccountingToken which will be set in each message published
for this subscription.
If the option MQSO_SET_IDENTITY_CONTEXT is specified, the accounting token is being generated by
the user and this field is an input field which contains the
AccountingToken to be set in each publication for this
subscription.
The length of this field is given by MQ_ACCOUNTING_TOKEN_LENGTH. The initial value of this field is MQACT_NONE.
If altering an existing subscription using the MQSO_ALTER option, the value of
AccountingToken in any future publication messages can be
changed.
On return from an MQSUB call using MQSO_RESUME, this field is set to the current
AccountingToken being used for the subscription.
PubApplIdentityData (MQCHAR32)
This is the value that is in the ApplIdentityData field of
the Message Descriptor (MQMD) of all publication messages matching this subscription.
ApplIdentityData is part of the identity context of the message.
For more information about message context, see Message context. For more information about the
ApplIdentityData field in the MQMD, see ApplIdentityData (MQCHAR32)
If the option MQSO_SET_IDENTITY_CONTEXT is not specified, the
ApplIdentityData which is set in each message published for this
subscription is blanks, as default context information.
If the option MQSO_SET_IDENTITY_CONTEXT is specified, the
PubApplIdentityData is being generated by the user and this
field is an input field which contains the ApplIdentityData to
be set in each publication for this subscription.
The length of this field is given by MQ_APPL_IDENTITY_DATA_LENGTH. The initial value of this field is the null string in C, and 32 blank characters in other programming languages.
If altering an existing subscription using the MQSO_ALTER option, the
ApplIdentityData of any future publication messages can be
changed.
On return from an MQSUB call using MQSO_RESUME, this field is set to the current
ApplIdentityData being used for the subscription.
SelectionString (MQCHARV)
This is the string used to provide the selection criteria used when subscribing for messages from a topic.
This variable length field will be returned on output from an MQSUB call using the MQSO_RESUME option, if a buffer is provided, and also there is a positive buffer length in VSBufSize. If no buffer is provided on the call, only the length of the selection string will be returned in the VSLength field of the MQCHARV. If the buffer provided is smaller than the space required to return the field, only VSBufSize bytes are returned in the provided buffer.
If SelectionString is specified incorrectly, according to the
description of how to use the MQCHARV - Variable Length String structure, or if it exceeds the maximum
length, the call fails with reason code MQRC_SELECTION_STRING_ERROR.
SelectionString usage is described in Selectors.
SubLevel (MQLONG)
This is the level associated with the subscription. Publications are only delivered to this subscription if it is in the set of subscriptions with the highest SubLevel value less than or equal to the PubLevel used at publication time. However, if a publication has been retained, it is no longer available to subscribers at higher levels because it is republished at PubLevel 1.
The value must be in the range zero to 9. Zero is the lowest level.
The initial value of this field is 1.
For more information see Intercepting publications.
If altering an existing subscription using the MQSO_ALTER option, then the SubLevel cannot be changed.
Combining a SubLevel with a value greater than 1 with the option MQSO_PUBLICATIONS_ON_REQUEST is not allowed.
On return from an MQSUB call using MQSO_RESUME, this field is set to the current level being used for the subscription.
ResObjectString (MQCHARV)
This is the long object name after the queue manager resolves the name provided in
ObjectName.
If the long object name is provided in ObjectString and
nothing is provided in ObjectName, then the value returned in
this field is the same as provided in ObjectString.
If this field is omitted (that is ResObjectString.VSBufSize is zero) then the
ResObjectString is not returned, but the length is returned in
ResObjectString.VSLength. If the length is shorter than the full ResObjectString then it is
truncated and returns as many of the rightmost characters as can fit in the provided length.
If ResObjectString is specified incorrectly, according to the
description of how to use the MQCHARV structure, or if it exceeds
the maximum length, the call fails with reason code MQRC_RES_OBJECT_STRING_ERROR.