2013-03-20 56 views
0

Spring批處理不會在並行模式下執行流。我究竟做錯了什麼?Spring批處理不會在並行模式下執行流。

<split id="preprocessingStep" next="decompress"> 
     <flow> 
      <step id="step11" next="step22"> 
       <tasklet ref="my1" /> 
      </step> 

      <step id="step22"> 
       <tasklet ref="my2" /> 
      </step> 

     </flow> 
     <flow> 
      <step id="step33"> 
       <tasklet ref="my3" /> 
      </step> 
     </flow> 
</split> 

回答

4

我認爲這是因爲您使用單線程任務執行程序。嘗試

<bean id="taskExecutor" class="org.springframework.core.task.SimpleAsyncTaskExecutor" 

和改變行添加到

<split id="preprocessingStep" task-executor="taskExecutor" next="decompress"> 

到你的配置。

+0

非常感謝!您的解釋非常有用。 – 2013-03-21 06:33:32