Specifying MQGET options using the MQGMO structure

The MQGMO structure is an input/output variable for passing options to the MQGET call.

The following sections help you to fill in some of the fields of this structure. There is a description of the structure in the WebSphere MQ Application Programming Reference.

StrucId
StrucId is a 4-character field used to identify the structure as a get-message options structure. Always specify MQGMO_STRUC_ID.
Version
Version describes the version number of the structure. MQGMO_VERSION_1 is the default. If you want to use the Version 2 fields or retrieve messages in logical order, specify MQGMO_VERSION_2. If you want to use the Version 3 fields or retrieve messages in logical order, specify MQGMO_VERSION_3. MQGMO_CURRENT_VERSION sets your application to use the most recent level.
Options
Within your code, you can select the options in any order; each option is represented by a bit in the Options field.

The Options field controls:

If you leave the Options field set to the default value (MQGMO_NO_WAIT), the MQGET call operates this way:

Platform Under syncpoint control
i5/OS No
UNIX(R) systems No
z/OS Yes
Windows systems No
WaitInterval
The WaitInterval field specifies the maximum time (in milliseconds) that the MQGET call waits for a message to arrive on the queue when you use the MQGMO_WAIT option. If no message arrives within the time specified in WaitInterval, the call completes and returns a reason code showing that there was no message that matched your selection criteria on the queue.

On WebSphere MQ for z/OS, if you use the MQGMO_SET_SIGNAL option, the WaitInterval field specifies the time for which the signal is set.

For more information on these options, see Waiting for messages and Signaling.

Signal1
Signal1 is supported on WebSphere MQ for z/OS and MQSeries for Compaq NonStop Kernel only.

If you use the MQGMO_SET_SIGNAL option to request that your application is notified when a suitable message arrives, you specify the type of signal in the Signal1 field. In WebSphere MQ on all other platforms, the Signal1 field is reserved and its value is not significant.

For more information, see Signaling.

Signal2
The Signal2 field is reserved on all platforms and its value is not significant.

For more information, see Signaling.

ResolvedQName
ResolvedQName is an output field in which the queue manager returns the name of the queue (after resolution of any alias) from which the message was retrieved.
MatchOptions
MatchOptions controls the selection criteria for MQGET.
GroupStatus
GroupStatus indicates whether the message that you have retrieved is in a group.
SegmentStatus
SegmentStatus indicates whether the item that you have retrieved is a segment of a logical message.
Segmentation
Segmentation indicates whether segmentation is allowed for the message retrieved.
MsgToken
Only supported in WebSphere MQ for z/OS.

MsgToken uniquely identifies a message.

For more information, see WebSphere MQ Workflow.

ReturnedLength
ReturnedLength is an output field in which the queue manager returns the length of message data returned (in bytes).