2
我想在春天批量使用單個作業並行執行多個步驟。以下是我的配置外觀。春季批次2.1.8並行多個步驟的執行有限制
<job id="gmegdc1" xmlns="http://www.springframework.org/schema/batch" >
<split id="splitStep" task-executor="taskExecutor">
<flow>
<step id="step1" parent="simpleStep1">
<tasklet ref="gdcTasklet1" task-executor="taskExecutor1" throttle-limit="6" />
</step>
</flow>
<flow>
<step id="step2" parent="simpleStep2">
<tasklet ref="gdcTasklet2" task-executor="taskExecutor2" throttle-limit="6" />
</step>
</flow>
<flow>
<step id="step3" parent="simpleStep3">
<tasklet ref="gdcTasklet3" task-executor="taskExecutor3" throttle-limit="6" />
</step>
</flow>
<flow>
<step id="step4" parent="simpleStep4">
<tasklet ref="gdcTasklet4" task-executor="taskExecutor4" throttle-limit="6" />
</step>
</flow>
</split>
</job>
<bean id="taskExecutor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
<property name="corePoolSize" value="25" />
<property name="maxPoolSize" value="25" />
</bean>
<bean id="taskExecutor1" class="org.springframework.core.task.SimpleAsyncTaskExecutor"/>
<bean id="taskExecutor2" class="org.springframework.core.task.SimpleAsyncTaskExecutor"/>
<bean id="taskExecutor3" class="org.springframework.core.task.SimpleAsyncTaskExecutor"/>
<bean id="taskExecutor4" class="org.springframework.core.task.SimpleAsyncTaskExecutor"/>
我想爲每一步運行6個線程。每次開始工作時,通過這種配置,每次只有8個線程以不同的步驟組合運行。由於這一些步驟沒有得到執行,我也獲得了所有線程運行的潛力。不知道這裏發生了什麼問題。
你有看看分區嗎?請參閱http://static.springsource.org/spring-batch/trunk/reference/html/scalability.html#partitioning –