Browse all messages

You can browse the messages in all queues by calling the appropriate browseMessages() method.

The following .NET example uses the QAManager.BrowseMessages() method to browse all queues:

QAMessage msg;
IEnumerator msgs = mgr.BrowseMessages();
while( msgs.MoveNext() ) {
      msg = (QAMessage)msgs.Current;
      // Process message.
}

The following C++ example uses the QAManager browseMessages function to browse all queues:

QAMessage *msg;
qa_browse_handle bh = mgr->browseMessages();
for (;;) {
  msg = mgr->browseNextMessage( bh );
  if( msg == qa_null ) {
    break;
  }
  // Process message.
  mgr->browseClose( bh );
}

The following Java example uses the QAManager.browseMessages method to browse all queues:

QAMessage msg;
java.util.Enumeration msgs = mgr.browseMessages();
while( msgs.hasMoreElements() ) {
    msg = (QAMessage)msgs.nextElement();
  // Process message.
}
See also