Reputation: 203
I have the below chuck step configuration. One of the processor is REST API POST call. so I dont want to retry if there is any exception. But even after I remove the retry configuration, it still retries immediately once from the reader step for the failed item. What could be missing here? Thank you.
return stepBuilderFactory.get("chunkStep")
.<File, CoopReqDTO>chunk(1)
.reader(filesReader)
.processor(processor())
.faultTolerant()
//.retry(Exception.class)
//.retryLimit(1)
.skip(Exception.class).skipLimit(Integer.MAX_VALUE)
.listener(pdfCaptureSkipListener)
.writer(compositeItemWriter())
.build();
Upvotes: 1
Views: 1668
Reputation: 31590
You can use FaultTolerantStepBuilder#noRetry to exclude any exception and (its subclasses) from the retry. You might also check FaultTolerantStepBuilder#processorNonTransactional if you want to cache processing results (this might be useful in your case to avoid re-doing a POST request).
Upvotes: 3