i'm triyng to retry spring batch FlatFileItemReader but no success.
FlatFileItemReader<Transaction> reader = new FlatFileItemReader<>();
Resource resource = new FileSystemResource("input/1-101-D-2017-212-volume-per-transaction.csv");
try {
resource.contentLength();
} catch (IOException e) {
e.printStackTrace();
}
reader.setResource(resource);
reader.setRecordSeparatorPolicy(new BlankLineRecordSeparatorPolicy());
DefaultLineMapper<Transaction> lineMapper = new DefaultLineMapper<>();
reader.setLineMapper(lineMapper);
reader.setStrict(false);
reader.setLinesToSkip(NUMBER_OF_HEADER_LINES);
DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();
reader.setSkippedLinesCallback(line -> tokenizer.setNames(line.split(",")));
lineMapper.setLineTokenizer(tokenizer);
lineMapper.setFieldSetMapper(new TransactionFieldSetMapper());
reader.setLineMapper(lineMapper);
return reader;
then into my step i have
.faultTolerant()
.retryLimit(3)
.retry(FileNotFoundException.class)
can someone give my some hint how can retry it?
RetryPolicy
in a chunk oriented step is not applied to the reader. Please check this answer for more details: stackoverflow.com/a/54903275/5019386 – Mahmoud Ben Hassine