Reputation: 243
In Spring Batch, in the job-request.xml file you can have the chunk's writer run a "compositeItemWriter" which looks something like this:
<bean id="compositeItemWriter"
class="org.springframework.batch.item.support.CompositeItemWriter">
<property name="delegates">
<list>
<ref bean="writer1" />
<ref bean="writer2" />
</list>
</property>
</bean>
I was wondering if there's anything similar for readers? I tried using org.springframework.batch.item.support.CompositeItemStream but apparently delegates does not exist as a property. Putting "reader1" or "reader2" in the delegates property list in compositeItemWriter similarly does not work (cannot convert readers to writers)
Any advice would be greatly appreciated
Thanks!
Upvotes: 1
Views: 6200
Reputation: 6075
MultiResourceItemReader reads items from multiple resources sequentially: http://docs.spring.io/spring-batch/apidocs/org/springframework/batch/item/file/MultiResourceItemReader.html
It will look like:
<bean id="itemReader" class="org.springframework.batch.item.file.MultiResourceItemReader">
<property name="resources" value="LIST_OF_FILES" />
<property name="delegate" ref="itemReaderDelegate" />
</bean>
Upvotes: 2