Search code examples
jberet

Can I get the beanIOItemReader record number in an ItemProcessor when using Jberet?


I am using a chunk to read a file and insert the contents into a database, one of the columns in the table requires the record number from the input file. Is there a way to get that in the object passed to the ItemProcessor or to get it from within the ItemProcessor?


Solution

  • I ended up using an ItemReadListener to get the StepContext metrics in the afterRead method and updating my Object read with the current read count.