RESOLVED - issue BATCH-486: Users must choose between skip and retry
Tweak the retry policy to account for fatal exceptions as well (they should not be retryable).
This commit is contained in:
@@ -68,6 +68,14 @@ public class SkipLimitStepFactoryBean extends SimpleStepFactoryBean {
|
||||
this.fatalExceptionClasses = fatalExceptionClasses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Protected getter for the fatal exceptions.
|
||||
* @return the fatalExceptionClasses
|
||||
*/
|
||||
protected Class[] getFatalExceptionClasses() {
|
||||
return fatalExceptionClasses;
|
||||
}
|
||||
|
||||
/**
|
||||
* Public setter for the {@link ItemKeyGenerator}. This is used to identify
|
||||
* failed items so they can be skipped if encountered again, generally in
|
||||
|
||||
@@ -119,6 +119,7 @@ public class StatefulRetryStepFactoryBean extends SkipLimitStepFactoryBean {
|
||||
SimpleRetryPolicy retryPolicy = new SimpleRetryPolicy(retryLimit);
|
||||
if (retryableExceptionClasses != null) {
|
||||
retryPolicy.setRetryableExceptionClasses(retryableExceptionClasses);
|
||||
retryPolicy.setFatalExceptionClasses(getFatalExceptionClasses());
|
||||
}
|
||||
|
||||
// Co-ordinate the retry policy with the exception handler:
|
||||
|
||||
Reference in New Issue
Block a user