Hi to all.. I'm newbie in spring batch and need some help.. hope could be simple for you guys..
I'm trying to read multiple resources (files) to create a message to be writen in a database. I cannot process the files in separated steps because they have data dependencies between the registers. Basicly line 1 in file1 plus line 1 in file2 is my register. So in a step processing i should have line n from all files(resources).
First I was thinking that my solution was creating a MultiResourceItemReader bean:
<bean id="multiReader" class="org.springframework.batch.item.file.MultiRe sourceItemReader">
<property name="resources" value="${input.file.list}" />
<property name="delegate" ref="simpleReader" />
<property name="saveState" value="true" />
</bean>
<bean id="simpleReader" class="org.springframework.batch.item.file.FlatFil eItemReader">
<property name="resource" value="${input.file.list}" />
<property name="lineTokenizer" ref="fileRecordTypes" />
<property name="fieldSetMapper" ref="messageMapper" />
</bean>
But in this case my simpleReader process each line separated, sequentialy for all files. What I need is quite different and I did not find any similar situation..
Could someone help me on that..
Thanks and advance..


Reply With Quote
