In spring batch, I have an requirement to read from the database and to write in a file, The no of rows allowed in a file is N, so if N+10 records are fetched then two files should be created containing N rows and 10 rows respectively.
Can someone please help me with the writer implementation? Is there any other easy way of doing it? Thanks.
Best How To :
Spring batch has
MultiResourceItemWriter were you can write based on number of lines
<property name="delegate" ref="flatFileItemWriter" />
<property name="itemCountLimitPerResource" value="3" />
<property name="resource" value="file:c:/logs/te" />