diff --git a/docs/src/site/docbook/reference/readersAndWriters.xml b/docs/src/site/docbook/reference/readersAndWriters.xml index 2430e1586..d15854e06 100644 --- a/docs/src/site/docbook/reference/readersAndWriters.xml +++ b/docs/src/site/docbook/reference/readersAndWriters.xml @@ -1182,28 +1182,18 @@
Multi-File Input - It a is common requirement to process multiple files in a single - step (e.g. all files in given directory, or files matching given pattern). - MultiResourceItemReader supports multi-file input - by wrapping a delegate - ResourceAwareItemReaderItemStream (both - FlatFileItemReader and - StaxEventItemReader implement this interface). - MultiResourceItemReader uses the delegate to read - items from the resource and takes care of correct rollback functionality - (potentially spanning file boundaries) as well as efficient restart (skips - already processed files without re-reading them). + It is a common requirement to process multiple files within a single + Step. Assuming the files are all formatted the same, the + MultiResourceItemReader supports this type of input + for both XML and FlatFile processing. Consider the following files in a + directory: - To restart correctly file ordering needs to be preserved between job - runs, which may not be easy to guarantee. In such circumstances we suggest - to use SortedMultiResourceItemReader which first - sorts resources using injected Comparator. By - default resources are ordered alphabetically by filename. + file-1.txt file-2.txt ignored.txt - Below is an example configuration where the - SortedMultiResourceItemReader is configured to read - multiple flat files (note standard Spring syntax is used to specify the - resources): + file-1.txt and file-2.txt are formatted the same and for business + reasons should be processed together. The + MuliResourceItemReader can be used to read in both + files by using wildcards: <bean id="multiResourceReader" class="org.springframework.batch.item.SortedMultiResourceItemReader"> @@ -1212,6 +1202,14 @@ </bean> + + The referenced delegate is a simple + FlatFileItemReader. The above configuration will + read input from both files, handling rollback and restart scenarios. It + should be noted that, as with any ItemReader, adding extra input (in this + case a file) could cause potential issues when restarting. It is + recommended that batch jobs work with their own individual directories + until completed successfully.
@@ -2225,7 +2223,7 @@ <property name="mapper"> <bean class="org.springframework.batch.sample.mapping.PlayerSummaryMapper" /> </property> - <property name="saveState" value="false" /> + <property name="saveState" value="false" /> <property name="sql"> <value> SELECT games.player_id, games.year_no, SUM(COMPLETES),