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, 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 Application Programming Reference.
The following sections describe the information supply as input to the MQGET call.
- Specifying connection handles
- Describing messages using the MQMD structure and the MQGET call
- Specifying MQGET options using the MQGMO structure
- Specifying the size of the buffer area
Parent topic:
Getting messages from a queue
fg12550_