When a message is delivered to you, you can examine the message’s properties, type, headers, and body. The functions used to process a message are described in Processing a Message.
Table 2–11 Functions Used to Process Messages
Function |
Description |
Gets message header properties. |
|
Gets user-defined message properties. |
|
Gets the message type: MQ_TEXT_MESSAGE or MQ_BYTES_MESSAGE |
|
Gets the body of an MQ_TEXT_MESSAGE message. |
|
Gets the body of an MQ_BYTES_MESSAGE message. |
|
Gets the destination where replies to this message should be sent. |
If you are interested in a message’s header information, you need to call the MQGetMessageHeaders function. If you need to read or check any user-defined properties, you need to call the MQGetMessageProperties function. Each of these functions passes back a properties handle. For information on how you can read property values, see Getting Message Properties.
Before you can examine the message body, you can call the MQGetMessageType function to determine whether the message is a text or bytes message. You can then call the MQGetTextMessageText, or the MQGetBytesMessageBytes function to get the contents of the message.
Some message senders specify a reply destination for their message. Use the MQGetMessageReplyTo function to determine that destination.