spring - Cannot get Remote Chunking to work for an existing batch job -


i need in getting spring batch remote chunking configuration work successfully. 2 approaches have been tried, according m.minella's youtube tutorial on remote chunking, original batch job configuration not require modified.

where according example here configuration of job has split based on given role, master or slave.

our current batch job configuration is:

<job id="samplejob" restartable="false"      xmlns="http://www.springframework.org/schema/batch">     <step id="settlementstep">         <tasklet task-executor="staskexecutor" throttle-limit="7">             <chunk reader="settlement_reader"                    processor="settlement_processor"                    writer="settlement_writer"                    commit-interval="1">             </chunk>         </tasklet>     </step> </job>  <bean id="settlementjobchunkhandler" class="org.springframework.batch.integration.chunk.remotechunkhandlerfactorybean">     <property name="chunkwriter" ref="settlementjobchunkwriter" />     <property name="step" ref="settlementstep" /> </bean>  <bean id="settlementjobchunkwriter" class="org.springframework.batch.integration.chunk.chunkmessagechannelitemwriter">     <property name="messagingoperations" ref="settlementjobmessagingtemplate"/>     <property name="replychannel" ref="settlementjob.replies.chunking" />     <property name="maxwaittimeouts" value="100" />     <property name="throttlelimit" value="100"/> </bean>  <bean id="settlementjobmessagingtemplate" class="org.springframework.integration.core.messagingtemplate">     <property name="defaultchannel" ref="settlementjob.requests.chunking" />     <property name="receivetimeout" value="100" /> </bean>  <int:channel id="settlementjob.replies.chunking">     <!--<int:queue/>     <int:interceptors>         <bean id="pollerinterceptor"                     class="org.springframework.batch.integration.chunk.messagesourcepollerinterceptor">             <property name="messagesource">                 <bean class="org.springframework.integration.jms.jmsdestinationpollingsource">                     <constructor-arg>                         <bean class="org.springframework.jms.core.jmstemplate">                             <property name="connectionfactory" ref="jmsconnectionfactory" />                             <property name="defaultdestinationname" value="queue-settlementjob-replies" />                             <property name="receivetimeout" value="100" />                         </bean>                     </constructor-arg>                 </bean>             </property>             <property name="channel" ref="settlementjob.incoming.chunking"/>         </bean>     </int:interceptors>--> </int:channel>  <int:channel id="settlementjob.requests.chunking"/> <int:channel id="settlementjob.incoming.chunking"/>  <bean id="settlementjobjmsdestinationpollingsource" class="org.springframework.integration.jms.jmsdestinationpollingsource">     <constructor-arg ref="jmstemplate"/> </bean>  <bean id="settlementjobrequests" class="org.apache.activemq.command.activemqqueue">     <constructor-arg index="0" value="queue-settlementjob-requests"/> </bean>  <bean id="settlementjobreplies" class="org.apache.activemq.command.activemqqueue">     <constructor-arg index="0" value="queue-settlementjob-replies"/> </bean> 

the above configuration common , shared both master , slave.

master node configuration:

    <!-- master --> <int-jms:outbound-channel-adapter channel="settlementjob.requests.chunking"                                   connection-factory="jmsconnectionfactory"                                   destination="settlementjobrequests">     <int:poller fixed-rate="1000"/> </int-jms:outbound-channel-adapter>  <int-jms:message-driven-channel-adapter connection-factory="jmsconnectionfactory"                                         destination="settlementjobreplies"                                         channel="settlementjob.incoming.chunking"/>  <bean id="settlementjobmessageextractor" class="org.springframework.batch.integration.chunk.jmsredeliveredextractor"/>  <int:transformer input-channel="settlementjob.incoming.chunking" output-channel="settlementjob.replies.chunking"                  ref="settlementjobmessageextractor" method="extract"> </int:transformer> 

slave node configuration:

<!-- slave configration --> <jms:listener-container connection-factory="jmsconnectionfactory" transaction-manager="transactionmanager"                         acknowledge="transacted" concurrency="8">     <jms:listener destination="queue-settlementjob-requests" response-destination="queue-settlementjob-replies"                   ref="settlementjobchunkhandler" method="handlechunk"/> </jms:listener-container>  <bean id="settlementjobchunkprocessor" class="org.springframework.batch.core.step.item.simplechunkprocessor">     <property name="itemprocessor" ref="settlement_processor"/>     <property name="itemwriter" ref="energy_writer"/> </bean>  <bean id="settlementjobchunkhandler" class="org.springframework.batch.integration.chunk.chunkprocessorchunkhandler">     <property name="chunkprocessor" ref="settlementjobchunkprocessor"/> </bean> 

the above configuration per opencredo github link, however, issue not records reaching amq. job hangs without completing , processing records.

of more 1000 test records, 17 processed. on single node, no master, no slave config, i.e. vanilla non-remote-chunking configuration, same job processes records successfully.

what missing.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -