I am having use case where the records are extracted from database and added in the flat file.

I need to add the footer for each file with number of records withing he file. I want make this functionality genric so all the extract batches can use this.

I am using -
  • MultiResourceItemWriter
  • FlatFileFooterCallback


I tried to get the writeCount from step execution, but that gives the total writeCount rather than the records in current file. I was looking for a call back which is called when a current file is about to compelete.


Is there any way i can ge the number of records in a single file being written?