You understand correctly - it's related to BATCH-540 - he wants to retrieve the raw input data if there's an exception during read - case in point, if tokenization fails.
A more permanent solution would be to pass this in as an argument to onSkipInRead, just like onSkipInWrite, except with the potential that it could be equal to null (e.g. if the exception is because the file can't be opened, etc.).
Here's the alternative, springforever:
This only solves for the FlatFileItemReader though, and not for other item reader implementations since their exceptions don't necessarily house extra state.Code:String originalInput = exception.getInput();
I don't think of this normally since people seem to cringe whenever I suggest making the state of an exception meaningful, but since we're laying out all the options...


Reply With Quote

