I am using Spring Batch job to run multiple jobs. All the jobs use a ItemReader and FlatFileItemWriter which reads some data and generate a text file. I have created One single batch job with its own Reader and Writer for each of the file that has to be created. For example if I am creating 10 different files, I have 10 jobs, I have 10 Readers and 10 writers. Is there a way that I can have only one job and one reader and one writer which can take care of all the requests of creating different files. The files that are have their own DTO.
public class ClassWriter1 extends FlatFileItemWriter<DTO1>{
}
public class ClassWriter2 extends FlatFileItemWriter<DTO2>{
}
etc...
AbstractJobConfig<T>
) and multiple concrete ones for each job (likeJob1Config extends AbstractJobConfig<DTO1>
,Job2Config extends AbstractJobConfig<DTO2>
) ? – Mahmoud Ben Hassine