<p>Once configured the queue 'selectorQueue' only delivers messages that are selected against the filter, i.e.,
only the messages whose 'color' properties are of 'red' values can be received by its consumers. Those that don't match
the filter will be dropped by the queue and therefore will never be delivered to any of its consumers.</p>
<p>In the example code, five messages with different 'color' property values are sent to queue 'selectorQueue'. One consumer
is created to receive messages from the queue. Of the five sent messages, two are of 'red' color properties, one is 'blue',
one is 'green' and one has not the 'color' propery at all. The result is that the consumer only gets the two 'red' messages.</p>
<h2>Example step-by-step</h2>
<p><i>To run the example, simply type <code>mvn verify</code> from this directory</i></p>
<ol>
<li>First we need to get an initial context so we can look-up the JMS connection factory and destination objects from JNDI. This initial context will get it's properties from the <code>client-jndi.properties</code> file in the directory <code>../common/config</code></li>
<li>Waiting for the message listener to check the received messages.</li>
<preclass="prettyprint">
<code>
Thread.sleep(5000);
</code>
</pre>
<li>And finally, <b>always</b> remember to close your JMS connections and resources after use, in a <code>finally</code> block. Closing a JMS connection will automatically close all of its sessions, consumers, producer and browser objects</li>