BATCH-1810: Documentation SimpleRetryPolicy code sample
This commit is contained in:
committed by
Michael Minella
parent
52b9692e74
commit
7a672267ef
@@ -42,6 +42,11 @@
|
||||
<surname>Minella</surname>
|
||||
</author>
|
||||
|
||||
<author>
|
||||
<firstname>Chris</firstname>
|
||||
<surname>Schaefer</surname>
|
||||
</author>
|
||||
|
||||
</authorgroup>
|
||||
|
||||
<legalnotice>
|
||||
|
||||
@@ -227,7 +227,9 @@ Foo result = template.execute(new RetryCallback<Foo>() {
|
||||
this list overrides the retryable list so that it can be used to give
|
||||
finer control over the retry behavior:</para>
|
||||
|
||||
<programlisting>SimpleRetryPolicy policy = new SimpleRetryPolicy(5);
|
||||
<programlisting>SimpleRetryPolicy policy = new SimpleRetryPolicy();
|
||||
// Set the max retry attempts
|
||||
policy.setMaxAttempts(5);
|
||||
// Retry on all exceptions (this is the default)
|
||||
policy.setRetryableExceptions(new Class[] {Exception.class});
|
||||
// ... but never retry IllegalStateException
|
||||
|
||||
Reference in New Issue
Block a user