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

SQL Anywhere 11.0.1 » QAnywhere » QAnywhere Reference » QAnywhere C++ API reference » QAManagerBase class


setMessageListenerBySelector function

void QAManagerBase::setMessageListenerBySelector(
  qa_const_string address,
  qa_const_string selector,
  QAMessageListener * listener
  • address   The destination address that the listener applies to.

  • selector   The selector to be used to filter the messages to be received.

  • listener   The message listener to associate with destination address.


Sets a message listener class to receive QAnywhere messages asynchronously, with a message selector.

The listener is an instance of a class implementing onMessage, the only method defined in the QAMessageListener interface. onMessage accepts a single QAMessage parameter.

The address parameter specifies a local queue name used to receive the message. You can only have one listener assigned to a given queue. The selector parameter specifies a selector to be used to filter the messages to be received on the given address.

If you want to listen for QAnywhere system messages, including push notifications and network status changes, specify "system" as the queue name. Use this method to receive message asynchronously.

For more information, see Receiving messages asynchronously and System queue.