Getting messages from a queue using the MQGET call
The MQGET call gets a message from an open local queue. It cannot get a
message from a queue on another system.
As input to the MQGET call, you must supply:
- A connection handle.
- A queue handle.
- A description of the message that you want to get from the queue. This
is in the form of a message descriptor (MQMD) structure.
- Control information in the form of a Get Message Options (MQGMO) structure.
- The size of the buffer that you have assigned to hold the message (MQLONG).
- The address of the storage in which to put the message.
The output from MQGET is:
- A reason code
- A completion code
- The message in the buffer area that you specified, if the call completes
successfully
- Your options structure, modified to show the name of the queue from which
the message was retrieved
- Your message descriptor structure, with the contents of the fields modified
to describe the message that was retrieved
- The length of the message (MQLONG)
There is a description of the MQGET call in the WebSphere MQ Application Programming Reference.
The following sections describe the information you must supply as input
to the MQGET call.