How to control the number of parallel Spring Batch jobs

后端 未结 2 592
有刺的猬
有刺的猬 2020-12-31 22:55

I have a report generating application. As preparation of such reports is heavyweight, they are prepared asynchronously with Spring Batch. Requests for such reports are crea

2条回答
  •  佛祖请我去吃肉
    2020-12-31 23:42

    That helped, many thanks. After replacing SimpleAsyncTaskExecutor I have exactly what I need. Code:

    @Bean
    public TaskExecutor jobLauncherTaskExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setMaxPoolSize(executorsPoolSize);
        executor.setCorePoolSize(executorsPoolSize);
        return executor;
    }
    

    Thanks f

提交回复
热议问题