简体   繁体   中英

Spring batch parallel processing

When I run multiple instances of a long running batch job using spring batch admin, it blocks other jobs from running after the jobLauncher thread pool task executor pool size is reached. But where as laucning multiple jobs from cron seems to work fine. Below is the job launcher configuration.

<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" />

Is spring batch admin Restful API using a different job launcher other than which is specified in xml config?

I would suggest looking at the other TaskExecutor options in the spring framework. In the worst-case, you could configure your own ThreadPoolTaskExecutor to use a cached threadpool, though I would caution against this if the number of concurrent jobs you might have running is large or unbounded.

This other SO post provides an example of this sort of configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM