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


The MQGetMessageType function passes back information about the type of a message: MQ_TEXT_MESSAGE, MQ_BYTES_MESSAGE , or MQ_MESSAGE.

MQGetMessageType(const MQMessageHandle messageHandle,
                       MQMessageType * messageType);

Return Value

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



A handle to a message whose type you want to determine.


Output parameter that contains the message type: MQ_TEXT_MESSAGE or MQ_BYTES_MESSAGE.

After you obtain the handle to a message, you can determine the type of the message using the MQGetMessageType function. Having determined its type, you can use the MQGetTextMessageText() function or the MQGetBytesMessageBytes() function to obtain the message content.

Note that other message types might be added in the future. You should not design your code so that it only expects two possible message types.