'multiple Spring integration task executors picking up same message from JMS queue

I am using spring integration to process multiple files from a queue.

Following is my configuration:

<si-jms:message-driven-channel-adapter
    id="someRegionalInboundAdapter" channel="TP_SomeLogBinaryChannel_AUDIT"
    container="someContainer" header-mapper="parentLogHeaderMapper" auto-startup="true"  />
<bean id="someContainer"
    class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="concurrentConsumers" value="10" />
    <property name="maxConcurrentConsumers" value="20" />
    <property name="connectionFactory" ref="cachingGlobalConnectionFactory" />
    <property name="destination" ref="someQ" />
    <property name="taskExecutor" ref="taskExecutor" />
    <property name="transactionManager" ref="transactionManager" />
    <property name="autoStartup" value="false" />
    <property name="errorHandler" ref="exceptionLogger"/>
</bean>
<task:executor id="taskExecutor" pool-size="20" queue-capacity="20" />  

My problem is that : multiple task-executors are picking up same message from MQ.

I want parallel execution but different threads should not pick up same message from MQ. Anything wrong with my config? How can I resolve this?

My MQ config

<!-- MQ Configuratipn -->
<Resource auth="Container" brokerName="localhost" brokerURL="tcp://localhost:61616" description="JMS Connection Factory" factory="org.apache.activemq.jndi.JNDIReferenceFactory" name="jms/QM_NH_DV0_0" type="org.apache.activemq.ActiveMQConnectionFactory"/>
    <Resource auth="Container" description="JMS queue" factory="org.apache.activemq.jndi.JNDIReferenceFactory" name="jms/Q_INTG_AUDT_PRCS" physicalName="Q_INTG_AUDT_PRCS" type="org.apache.activemq.command.ActiveMQQueue"/>
    <Resource auth="Container" description="JMS queue" factory="org.apache.activemq.jndi.JNDIReferenceFactory" name="jms/Q_ERRR_PRCS" physicalName="Q_ERRR_PRCS" type="org.apache.activemq.command.ActiveMQQueue"/>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source