title: How to thread pool a Spring JMS listener
body: <p>I am setting up a JMS subscriber listener as follows with the goal of achieving a pool of 5 threads listening to topATopic, however, what I see at runtime is multiple consumers processing the same record (recordCount*#of consumers).</p>
  
  <p>I am assuming I am doing something wrong considering I am new to spring.</p>
  
  <pre><code>&lt;bean id="messageListener" class="com.abc.app.mdp.Receiver"&gt;
  &lt;property name="bean" ref="bean" /&gt;
  &lt;/bean&gt;
  
  &lt;jms:listener-container container-type="default"
  connection-factory="connectionFactory" acknowledge="auto" concurrency="5" destination-type="topic" prefetch="1" cache="none" &gt;
  &lt;jms:listener destination="topCli_Service" ref="messageListener" 
  method="onMessage" subscription="AProjectSubscriber" /&gt;
  &lt;/jms:listener-container&gt;
  
  &lt;bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryB ean"&gt;
  &lt;property name="jndiName" value="jms/jms-top-notx" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Can somebody please point me in a direction to achieve my goal?</p>