title: Spring batch: Fault Tolerant
body: <p>I have the following Step:</p>
  
  <pre><code>    return stepBuilderFactory.get("billStep")
              .allowStartIfComplete(true)
              .chunk(20000)
              .reader(billReader)
              .processor(billProcessor)
              .faultTolerant()
              .skipLimit(Integer.MAX_VALUE)
              .skip(BillSkipException.class)
              .listener(billReaderListener)
              .listener(billSkipListener)
              .writer(billRepoItemWriter)
              .build();
  </code></pre>
  
  <p>Is my understanding correct, that fault tolerant means that when an exception is thrown in billProcessor, it will be processed in skip listener and then the next row/item will be processed in billProcessor?</p>
  
  <p>I noticed upon adding in debug logs - that items/rows were "re-processed" when an exception is thrown in the processor. (probably because of faultTolerant config. 
  But, what if I am processing 2 million records, and 300,000 of them were skipped - or throws a skip exception - isn't it an issue in performance if some of these were "re-processed")</p>
  
  <p>And the big problem is - <strong>the next row/item is skipped. They were not processed in the processor at all.</strong></p>
  
  <p>If I remove the faultTolerant and SkipListener - and directly save the skipped records in the database (what skiplistener is doing) - it is working, but is this solution correct?</p>