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:
  1. Call MQOPEN to open the queue for browsing, specifying the MQOO_BROWSE option.
  2. 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.

  3. Call MQCLOSE to close the queue.