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

SQL Anywhere 11.0.1 (Français) » QAnywhere » QAnywhere Reference » QAnywhere .NET API reference » QAnywhere .NET API for clients (.NET 2.0) » QAManagerBase interface


SetMessageListenerBySelector2 method

Sets a MessageListener2 delegate to receive QAnywhere messages asynchronously, with a message selector. See MessageListener2 delegate.

Visual Basic
Public Sub SetMessageListenerBySelector2( _
   ByVal address As String, _
   ByVal selector As String, _
   ByVal listener As MessageListener2 _
public void SetMessageListenerBySelector2(
   string  address,
   string  selector,
   MessageListener2 listener
  • address   The address of messages.

  • listener   The listener to register.

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


Use this method to receive message asynchronously.

MessageListener2 delegate accepts a single QAMessage parameter.

The SetMessageListener2 address parameter specifies a local queue name used to receive the message. You can only have one listener delegate 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. You may set an ExceptionListener2 and a MessageListener2 for a given address, but you must be consistent with the Listener/Listener2 delegates. That is, you cannot set an ExceptionListener and a MessageListener2, nor an ExceptionListener2 and a MessageListener, for the same address.

If you want to listen for QAnywhere system messages, including push notifications and network status changes, specify system as the queue name.

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