What's the difference between sequence of steps and flow in spring batch configuration?

I was reading a spring doc.

the document shows two different examples

5.3.1 Serial stream

<job id="job">
    <step id="stepA" parent="s1" next="stepB" />
    <step id="stepB" parent="s2" next="stepC"/>
    <step id="stepC" parent="s3" />
</job>

      

and

5.3.6. External flow definitions and job dependencies

<job id="job">
    <flow id="job1.flow1" parent="flow1" next="step3"/>
    <step id="step3" parent="s3"/>
</job>

<flow id="flow1">
    <step id="step1" parent="s1" next="step2"/>
    <step id="step2" parent="s2"/>
</flow>

      

what's the difference between using some steps and threads having multiple steps?

I'm confused. Please help me.

+5


source to share


1 answer


The second form allows reuse flow1

in another job.

<job id="job2">
    <flow id="job2.flow1" parent="flow1" next="job2.step3"/>
    <step id="job2.step3" parent="s3"/>
</job>

      



From the official doc:

The effect of defining an external thread is that it is easy to insert steps from the external thread into the work as if they were inline. Thus, many jobs can reference the same template by flowing and linking such templates into different logical flows. It is also a good way to decouple integration testing from separate threads.

+7


source







All Articles