Browsing messages on a queue
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 and CorrelId fields of the MQMD structure to null after each MQGET call in order to see all messages.
- Call MQCLOSE to close the queue.
- The browse cursor
- Browsing messages when the message length is unknown
- Removing a message that you have browsed
Parent topic:
Writing a WebSphere MQ application
fg12830_