Creating message selectors

You can use selectors to specify which messages you want delivered to a message queue. Once you add a selector to a queue, the message service delivers only those messages whose message topic matches the selector. You can create message selectors using EAServer Manager—see Chapter 8, “Setting up the Message Service,” in the EAServer System Administration Guide. You can also create message selectors programmatically. This example illustrates how to add a message selector to MyQueue to request notification of a new stock value:

MessageService cms = getMessageService();
cms.addSelector("MyQueue", 
   "topic = 'stock.SY' AND value > 50");