Message selectors

To filter the messages you receive and to subscribe to specific message topics, use a message selector.

Message selectors must conform to the JMS selector specification, which is a subset of the SQL-92 syntax—see the JMS 1.1 Specification.

StepsAdding a message selector to an MDB

  1. Edit the user configuration script for the EJB-JAR in which the MDB component is defined.

    For example, to receive all published messages with the stock symbol “SY,” use the following message listener configuration:

    <setProperties component="ejb.components.cmstests.MyTopicListener">
       <messageListener queue="" topic="StockPrice" 
         selector="symbol = 'SY'" durable="true" threadCount="1" /> 
    </setProperties>