0

I have a master job in Spring batch . I have 2 other jobs. The steps of these two jobs are

Job1= master job steps+master job flows+ step1
Job2= master job steps+ master job flows+step 2

From above, Job 1 and Job 2 share master job steps as common . I do not know how to reuse the same job between different jobs . How can I do it?

1 Answers1

0

You can create an abstract job bean definition for common properties and two concrete job definitions with the specific step for each job. You can find an example in the Spring Batch repository here. This is a Spring Framework feature not a Spring Batch feature. This post might help as well: What is meant by abstract="true" in spring?

If you use the Java configuration style, you can do something like Spring Batch - abstract Step definition in Java configuration?.

Mahmoud Ben Hassine
  • 28,519
  • 3
  • 32
  • 50