Browsing messages on a queue
Use this information to find out about browsing messages on a queue using the MQGET call.
To use the MQGET call to browse the messages on a queue:
- Call MQOPEN to open the queue for browsing, specifying the MQOO_BROWSE option.
- To browse the first message on the queue, call
MQGET with the MQGMO_BROWSE_FIRST option. To find the message that
you want, call MQGET repeatedly with the MQGMO_BROWSE_NEXT option
to step through many messages.
You must set the
MsgId
andCorrelId
fields of the MQMD structure to null after each MQGET call in order to see all messages. - Call MQCLOSE to close the queue.