Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.0 (Français) » QAnywhere » Writing QAnywhere client applications » Browsing QAnywhere messages


Browsing messages in a queue

You can browse the messages in a given queue by supplying the queue name to the appropriate browseMessagesByQueue() method.

The following .NET example uses the QAManager.BrowseMessagesByQueue method to browse a queue:

QAMessage msg;
IEnumerator msgs = mgr.BrowseMessagesByQueue( "q1" );
while( msgs.MoveNext() ) {
  msg = (QAMessage)msgs.Current;
  // Process message.

The following C++ example uses the QAManager browseMessagesByQueue function to browse a queue:

QAMessage *msg;
qa_browse_handle bh = mgr->browseMessagesByQueue( _T("q1") );
for (;;) {
  msg = mgr->browseNextMessage( bh );
  if( msg == qa_null ) {
  // Process message.
mgr->browseClose( bh );

The following Java example uses the QAManager.browseMessagesByQueue method to browse a queue:

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