How to thread pool a JMS listener
I am now 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 consumer processing the same record*#of consumers. I am assuming I am doing something wrong.
Code:
<bean id="messageListener" class="com.abc.app.mdp.Receiver">
<property name="bean" ref="bean" />
</bean>
<jms:listener-container container-type="default"
connection-factory="connectionFactory" acknowledge="auto" concurrency="5" destination-type="topic" prefetch="1" cache="none" >
<jms:listener destination="topCli_Service" ref="messageListener"
method="onMessage" subscription="AProjectSubscriber" />
</jms:listener-container>
<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryB ean">
<property name="jndiName" value="jms/jms-top-notx" />
</bean>
Thoughts?