MDGID (24-byte bit string)
Group identifier.
This is a byte string that is used to identify the particular message group or logical message to which the physical message belongs. MDGID is also used if segmentation is allowed for the message. In all of these cases, MDGID has a non-null value, and one or more of the following flags is set in the MDMFL field:
- MFMIG
- MFLMIG
- MFSEG
- MFLSEG
- MFSEGA
If none of these flags is set, MDGID has the special null value GINONE.
This field need not be set by the application on the MQPUT or MQGET call if:
- On the MQPUT call, PMLOGO is specified.
- On the MQGET call, MOGRPI is not specified.
These are the recommended ways of using these calls for messages that are not report messages. However, if the application requires more control, or the call is MQPUT1, the application must ensure that MDGID is set to an appropriate value.
Message groups and segments can be processed correctly only if the group identifier is unique. For this reason, applications should not generate their own group identifiers; instead, applications should do one of the following:
- If PMLOGO is specified, the queue manager automatically generates a unique group identifier for the first message in the group or segment of the logical message, and uses that group identifier for the remaining messages in the group or segments of the logical message, so the application does not need to take any special action. This is the recommended procedure.
- If PMLOGO is not specified, the application should request the queue manager to generate the group identifier, by setting MDGID to GINONE on the first MQPUT or MQPUT1 call for a message in the group or segment of the logical message. The group identifier returned by the queue manager on output from that call should then be used for the remaining messages in the group or segments of the logical message. If a message group contains segmented messages, the same group identifier must be used for all segments and messages in the group.
When PMLOGO is not specified, messages in groups and segments of logical messages can be put in any order (for example, in reverse order), but the group identifier must be allocated by the first MQPUT or MQPUT1 call that is issued for any of those messages.
On input to the MQPUT and MQPUT1 calls, the queue manager uses the value detailed in Table 31. On output from the MQPUT and MQPUT1 calls, the queue manager sets this field to the value that was sent with the message if the object opened is a single queue and not a distribution list, but leaves it unchanged if the object opened is a distribution list. In the latter case, if the application needs to know the group identifiers generated, the application must provide MQPMR records containing the PRGID field.
On input to the MQGET call, the queue manager uses the value detailed in Table 16. On output from the MQGET call, the queue manager sets this field to the value for the message retrieved.
The following special value is defined:
- GINONE
- No group identifier specified.
The value is binary zero for the length of the field. This is the value that is used for messages that are not in groups, not segments of logical messages, and for which segmentation is not allowed.
The length of this field is given by LNGID. The initial value of this field is GINONE. This field is ignored if MDVER is less than MDVER2.