Browsing messages using a selector

You can use message selectors to select messages for browsing. A message selector is a SQL-like expression that specifies a condition to select a subset of messages to consider for browse operations.

The syntax and semantics of message selectors are exactly the same as the condition part of transmission rules.

See Condition syntax.

The following .NET example browses all messages in the message store that have a property called intprop with value 1.

QAMessage msg;
IEnumerator msgs = mgr.BrowseMessagesBySelector( "intprop = 1" );
while( msgs.MoveNext() ) {
  msg = (QAMessage)msgs.Current;
  // Process message.
}

The following C++ example browses all messages in the message store that have a property called intprop with value 1.

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

The following Java example browses all messages in the message store that have a property called intprop with value 1.

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