Spring Batch Course Notes 14- Parallel Flow Job


When we have scenario where we need to setup dependencies between the steps and make the steps runs parallely based on its step dependency being satisfied we implement the parallel job flow.

  • Create the individual steps as per the requirement.
  • Create a new Flow object using the FlowBuilder class.
    • In the builder set the .start,.next,and .build methods to mention what is the start of the flow and the steps associated with the flow.
    • Do this for all the individual flows of the job
  • Now group the individual flows of the job in a new Flow object
    • Add the .split method to assign a new SimpleAsyncTaskExecutor
    • Add the .add method and assign all the child flows under the main parent that needs to be executed paralelly.
    • use the .build to build the composite flow
  • So in the job instead of wadding the steps ,we need to add the flows now use the .start,.next and .end to describe the order of the different flows created and do the .build to build the job.