Sun Java System Message Queue 4.3 Developer's Guide for C Clients


The MQGetBytesMessageBytes function passes back the address and size of a bytes message body.

MQGetBytesMessageBytes(const MQMessageHandle messageHandle,
 const MQInt8 * messageBytes
 MQInt32 * messageBytesSize);

Return Value

MQStatus. See the MQStatusIsError() function for more information.



A handle to a message that is passed to you when you receive a message.


Output parameter that contains the start address of the bytes that constitute the body of this bytes message.


Output parameter that contains the size of the message body in bytes.

After you obtain the handle to a message, you can use the MQGetMessageType() function to determine its type and, if the type is MQ_BYTES_MESSAGE, you can use the MQGetBytesMessageBytes function to retrieve the message bytes (message body).

The bytes message passed to you by this function is not a copy. You should not modify the bytes or attempt to free it.