diff --git a/docs/src/site/docbook/reference/readersAndWriters.xml b/docs/src/site/docbook/reference/readersAndWriters.xml index d642d8461..6b0ed0261 100644 --- a/docs/src/site/docbook/reference/readersAndWriters.xml +++ b/docs/src/site/docbook/reference/readersAndWriters.xml @@ -1138,6 +1138,42 @@ The StepListener interface will be discussed in more detail in Chapter 4. For now, it is sufficient to know that the proxy must be registered. + + +
+ 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). + + + + 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. + + + + 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): + + + + + + + ]]> + +