using spring batch to execute jobs in parallel

∥☆過路亽.° 提交于 2019-11-28 02:02:47

问题


I have a use case as follows:

1)There is a Parentjob which has multiple child jobs.
2)All child jobs should be executed in parallel.
3)The parent job should wait until all child jobs are done.
4)One child jobs are done control returns to master
5)Master job is completed.
6)In case any of the child job throws exception then also control should return to master job

Is this possible using spring batch?

EDIT : Am not looking to execute multiple steps of job in parellel.But multiple child jobs of same parent in parallel


回答1:


Maybe something like that?

  1. Create job
  2. Add chunk tasklet to this job.
    1. Reader get new job
    2. Processor start it
  3. Run this chunk with task executor and thread pool with 10 threads.
  4. Profit! :)


来源:https://stackoverflow.com/questions/19347084/using-spring-batch-to-execute-jobs-in-parallel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!