How to configure a Spring batch job with single reader and calling multiple writers depending on object returned
问题 Below is the job file currently i'm using. <batch:job id="job1"> <batch:step id="step1"> <batch:tasklet> <batch:chunk reader="reader" processor="processor" writer="ItemWriter" commit-interval="3"> </batch:chunk> </batch:tasklet> </batch:step> </batch:job> 回答1: As was said in the Luca's comment, you can use a ClassifierCompositeItemWriter which needs a org.springframework.classify.Classifier . One of the few implementations of the latter is org.springframework.classify