2014-10-08 183 views
1

當我使用spring batch admin運行多個長時間運行的批處理作業實例時,它會在達到jobLauncher線程池任務執行程序池大小後阻止其他作業運行。但是,從cron創造多個職位似乎工作得很好。以下是作業啓動器配置。Spring批處理並行處理

<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher"> 
<property name="jobRepository" ref="jobRepository" /> 
    <property name="taskExecutor" ref="jobLauncherTaskExecutor" /> 
</bean> 

<task:executor id="jobLauncherTaskExecutor" pool-size="6" rejection-policy="ABORT" /> 

是spring批處理管理員restful API使用不同的作業啓動程序而不是在xml config中指定的?

回答

0

我會建議看看春季框架中的其他TaskExecutor選項。在最壞的情況下,您可以配置自己的ThreadPoolTaskExecutor以使用緩存的線程池,但如果您可能運行的併發作業數量很大或無限,我會提醒注意。

這個其他SO後提供了這種配置的例子。