Server evaluates the corresponding message headers of the messages against each selector, if any, and then delivers
the 'matched' messages to its consumer. Please consult the JMS 1.1 specification for full details.</p>
<p>In this example, three message consumers are created on a topic. The first consumer is created with selector
<code>'color=red'</code>, it only receives messages that
have a 'color' string property of 'red' value; the second is created with selector <code>'color=green'</code>, it
only receives messages who have a 'color' string property of
'green' value; and the third without a selector, which means it receives all messages. To illustrate, three messages
with different 'color' property values are created and sent.</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>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>