I have been surfing several websites since few days to find a generic solution to this problem : How to identify which input record is causing the Batch process to fail in exception cases?
I have a requirement where I need to log that line no. and corresponding Exception. Note that the record can fail in any Batch phase - Reading
, Processing
, Writing
.
I am new to Java Spring Batch and working at this problem statement. I did find a few options, but not sure if they provide a generic solution:
- Create a property in MyObject and set it incrementally in Reader
- Implement
ItemCountAware
, create a property in MyObject and manually increment it by callingsetItemCount
Is there an easier and generic way to identify the record no failing in any Batch phase?