@Target(value={METHOD,TYPE}) @Retention(value=RUNTIME) @Documented public @interface Retryable
| Modifier and Type | Optional Element and Description |
|---|---|
Backoff |
backoff
Specify the backoff properties for retrying this operation.
|
String |
exceptionExpression
Specify an expression to be evaluated after the
SimpleRetryPolicy.canRetry()
returns true - can be used to conditionally suppress the retry. |
Class<? extends Throwable>[] |
exclude
Exception types that are not retryable.
|
Class<? extends Throwable>[] |
include
Exception types that are retryable.
|
String |
interceptor
Retry interceptor bean name to be applied for retryable method.
|
String |
label
A unique label for statistics reporting.
|
int |
maxAttempts |
String |
maxAttemptsExpression |
boolean |
stateful
Flag to say that the retry is stateful: i.e.
|
Class<? extends Throwable>[] |
value
Exception types that are retryable.
|
public abstract String interceptor
public abstract String label
public abstract boolean stateful
public abstract int maxAttempts
public abstract String maxAttemptsExpression
maxAttempts().public abstract String exceptionExpression
SimpleRetryPolicy.canRetry()
returns true - can be used to conditionally suppress the retry. Only invoked after
an exception is thrown. The root object for the evaluation is the last Throwable.
Other beans in the context can be referenced.
For example:
"message.contains('you can retry this')".
and
"@someBean.shouldRetry(#root)".
Copyright © 2018 SpringSource. All rights reserved.