Class MultiResourceItemWriter<T>

Type Parameters:
T - item type
All Implemented Interfaces:
ItemStream, ItemStreamWriter<T>, ItemWriter<T>

public class MultiResourceItemWriter<T> extends AbstractItemStreamItemWriter<T>
Wraps a ResourceAwareItemWriterItemStream and creates a new output resource when the count of items written in current resource exceeds setItemCountLimitPerResource(int). Suffix creation can be customized with setResourceSuffixCreator(ResourceSuffixCreator).

Note that new resources are created only at chunk boundaries i.e. the number of items written into one resource is between the limit set by

This writer will create an output file only when there are items to write, which means there would be no empty file created if no items are passed (for example when all items are filtered or skipped during the processing phase).

Author:
Robert Kasanicky, Mahmoud Ben Hassine