Spring integration is working fine on a single node cluster. However the partitionStep is not getting completed and remains in STARTED state forever when we deploy our application on multiple nodes. It seems that PartitionStep is waiting in the receive method and never marks the step COMPLETED. Below is the configuration which I am using. Is there any way to start aggregator on master node only?
Master Configuration:
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
<prop key="java.naming.provider.url">t3://localhost:7001</prop>
</props>
</property>
</bean>
<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate" ref="jndiTemplate" />
<property name="jndiName" value="jmsConnectionFactory" />
</bean>
<int:channel id="requestsChannel" />
<bean id="reqQueue" class="org.springframework.jndi.JndiObjectFactoryBean"
lazy-init="true" scope="prototype">
<property name="jndiTemplate">
<ref bean="jndiTemplate" />
</property>
<property name="jndiName">
<value>masterRequestQueue</value>
</property>
</bean>
<int-jms:outbound-channel-adapter
connection-factory="connectionFactory" channel="requestsChannel" destination="reqQueue" />
<int:channel id="replyChannel" />
<bean id="replyQueue" class="org.springframework.jndi.JndiObjectFactoryBean"
lazy-init="true" scope="prototype">
<property name="jndiTemplate">
<ref bean="jndiTemplate" />
</property>
<property name="jndiName">
<value>masterReplyQueue</value>
</property>
</bean>
<int-jms:message-driven-channel-adapter connection-factory="connectionFactory" destination="replyQueue" channel="replyChannel" auto-startup="false"/>
<int:channel id="aggregatedReplyChannel">
<int:queue />
</int:channel>
<int:aggregator ref="partitionHandler"
input-channel="replyChannel" output-channel="aggregatedReplyChannel" />
Slave Configuration:
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
<property name="environment">
<props>
<prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
<prop key="java.naming.provider.url">t3://localhost:7001</prop>
</props>
</property>
</bean>
<bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate" ref="jndiTemplate" />
<property name="jndiName" value="jmsConnectionFactory" />
</bean>
<task:executor id="taskExecutor" pool-size="10" />
<int:channel id="requestsChannel">
<int:dispatcher task-executor="taskExecutor" />
</int:channel>
<bean id="reqQueue" class="org.springframework.jndi.JndiObjectFactoryBean"
lazy-init="true" scope="prototype">
<property name="jndiTemplate">
<ref bean="jndiTemplate" />
</property>
<property name="jndiName">
<value>masterRequestQueue</value>
</property>
</bean>
<int-jms:message-driven-channel-adapter connection-factory="connectionFactory" destination="reqQueue" channel="requestsChannel" />
<int:channel id="replyChannel" />
<bean id="replyQueue" class="org.springframework.jndi.JndiObjectFactoryBean"
lazy-init="true" scope="prototype">
<property name="jndiTemplate">
<ref bean="jndiTemplate" />
</property>
<property name="jndiName">
<value>masterReplyQueue</value>
</property>
</bean>
<int-jms:outbound-channel-adapter
connection-factory="connectionFactory" destination="replyQueue" channel="replyChannel" />
<int:service-activator input-channel="requestsChannel"
output-channel="replyChannel" ref="stepExecutionRequestHandler" />
Spring batch version 3.0.3 Spring core version 4.0.5 Spring integration version 4.0.1