*i have implemented skipListener interface to logged out the exceptions, those are getting while reading the items. but the skip listener is executing multiple times why? if i mention chunk size 1. it is executing one time only
@Autowired
private TransactionHistoryCsvImportSkipListner transactionHistoryCsvImportSkipListner;
//configuration class
@Bean
public Step transactionHistoryStep() {
return stepBuilderFactory.get("transactionHistoryStep")
.<TransactionHistory,TransactionHistory>chunk(1000)//if i put chunk size 1. it is working fine.
.reader(reader())
.processor(processor())
.writer(writer())
.faultTolerant()
.skipLimit(500)
.skip(Exception.class)
.listener(transactionHistoryCsvImportSkipListner)
.build();
}
// здесь я записываю неверные записи @Component открытый класс TransactionHistoryCsvImportSkipListner реализует SkipListener {приватный статический финальный Logger logger = LoggerFactory.getLogger (TransactionHistoryCsvImportSkipListner.class);@Override public void onSkipInRead (Throwable t) {logger.error («Исключения TransactionHistoryCsvImport есть» + t);
}
expected result :
2019-Oct-30 15:07:30.076 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 8 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[ring,hyd,9.8.19,445]
2019-Oct-30 15:07:30.076 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 9 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[bottle,sec,30.12.19,44467]
2019-Oct-30 15:07:30.077 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 10 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[pickel,vizag,8.9.29,34.65765]
actual result:
2019-Oct-30 15:07:30.076 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 8 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[ring,hyd,9.8.19,445]
2019-Oct-30 15:07:30.076 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 9 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[bottle,sec,30.12.19,44467]
2019-Oct-30 15:07:30.077 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 10 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[pickel,vizag,8.9.29,34.65765]
2019-Oct-30 15:07:30.198 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 8 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[ring,hyd,9.8.19,445]
2019-Oct-30 15:07:30.200 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 9 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[bottle,sec,30.12.19,44467]
2019-Oct-30 15:07:30.200 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 10 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[pickel,vizag,8.9.29,34.65765]
2019-Oct-30 15:07:30.306 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 8 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[ring,hyd,9.8.19,445]
2019-Oct-30 15:07:30.306 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 9 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[bottle,sec,30.12.19,44467]
2019-Oct-30 15:07:30.307 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 10 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[pickel,vizag,8.9.29,34.65765]
2019-Oct-30 15:07:30.432 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 8 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[ring,hyd,9.8.19,445]
2019-Oct-30 15:07:30.432 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 9 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[bottle,sec,30.12.19,44467]
2019-Oct-30 15:07:30.432 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 10 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[pickel,vizag,8.9.29,34.65765]
2019-Oct-30 15:07:30.535 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 8 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[ring,hyd,9.8.19,445]
2019-Oct-30 15:07:30.535 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 9 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[bottle,sec,30.12.19,44467]
2019-Oct-30 15:07:30.535 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 10 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[pickel,vizag,8.9.29,34.65765]
2019-Oct-30 15:07:30.695 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 8 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[ring,hyd,9.8.19,445]
2019-Oct-30 15:07:30.696 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 9 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[bottle,sec,30.12.19,44467]
2019-Oct-30 15:07:30.696 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 10 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[pickel,vizag,8.9.29,34.65765]
2019-Oct-30 15:07:31.054 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 8 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[ring,hyd,9.8.19,445]
2019-Oct-30 15:07:31.054 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 9 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[bottle,sec,30.12.19,44467]
2019-Oct-30 15:07:31.056 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 10 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[pickel,vizag,8.9.29,34.65765]
2019-Oct-30 15:07:31.331 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 8 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[ring,hyd,9.8.19,445]
2019-Oct-30 15:07:31.331 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 9 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[bottle,sec,30.12.19,44467]
2019-Oct-30 15:07:31.331 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 10 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[pickel,vizag,8.9.29,34.65765]
2019-Oct-30 15:07:31.664 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 8 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[ring,hyd,9.8.19,445]
2019-Oct-30 15:07:31.664 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 9 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[bottle,sec,30.12.19,44467]
2019-Oct-30 15:07:31.664 ERROR [http-nio-8877-exec-2] c.a.c.TransactionHistoryCsvImportSkipListner - TransactionHistoryCsvImport Exceptions Are org.springframework.batch.item.file.FlatFileParseException: Parsing error at line: 10 in resource=[file [C:\Users\Aisha Anjum\Desktop\Book1.csv]], input=[pickel,vizag,8.9.29,34.65765]*