Sun GlassFish Message Queue 4.4 Developer's Guide for C Clients


The MQGetTextMessageText function passes back the contents of a text message.

MQGetTextMessageText(const MQMessageHandle messageHandle,
                           ConstMQString * messageText);

Return Value

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



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


The output parameter that points to the message text.

After you obtain the handle to a message, you can use the MQGetMessageType() function to determine its type and, if the type is text, you can use the MQGetTextMessageText() function to retrieve the message text.

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