0

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"/>
Vrishank
  • 302
  • 4
  • 22
  • are you picking file from queue or topic? You will get this [behaviour](http://activemq.apache.org/how-does-a-queue-compare-to-a-topic.html) on topic. – Rohit Aug 31 '18 at 09:29
  • I am picking from queue – Vrishank Aug 31 '18 at 09:45
  • The `DefaultMessageListenerContainer` looks good. There may be a problem somewhere else. Share you channel details. – Rohit Aug 31 '18 at 09:52
  • Edited MQ config details from my server.xml. And this issue is happening only on high load conditions – Vrishank Aug 31 '18 at 09:56
  • Can you really confirm that they are the same messages via `DEBUG` for the `org.springframework.integration.jms.ChannelPublishingJmsMessageListener` category? There is going to be a log like `converted JMS Message ... to integration Message payload`? Also why do you think that the problem is really on the `` level, but not a bit downstream in the flow? – Artem Bilan Aug 31 '18 at 13:22
  • Yes. I checked from debug as well as database logs. I am getting same file. – Vrishank Aug 31 '18 at 15:42

0 Answers0