Annotation Interface Retryable
@Documented
@Retention(RUNTIME)
@Target({METHOD,TYPE,ANNOTATION_TYPE})
@Around
@Type(DefaultRetryInterceptor.class)
public @interface Retryable
AOP Advice that can be applied to any method.
- Since:
- 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe maximum integral digits for retry attempts validation. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescription@Digits(integer=4,fraction=0) StringReturns the maximum number of retry attempts.Returns the exception type that should be intercepted for retry handling.Returns the delay between retry attempts.Returns the exception types to exclude, which defaults to none.Returns the exception types to include, which defaults to all.@Digits(integer=1,fraction=2) StringReturns the jitter factor used to apply random deviation to retry delays.Returns the maximum overall delay.@Digits(integer=2,fraction=2) StringReturns the multiplier to use to calculate the delay.Class<? extends RetryPredicate> Returns the retry predicate class to use instead ofincludes()andexcludes().Returns the exception types to include, which defaults to all.
-
Field Details
-
MAX_INTEGRAL_DIGITS
static final int MAX_INTEGRAL_DIGITSThe maximum integral digits for retry attempts validation.- See Also:
-
-
Element Details
-
value
-
includes
-
excludes
-
attempts
Returns the maximum number of retry attempts.- Returns:
- The maximum number of retry attempts
- Default:
"3"
-
delay
String delayReturns the delay between retry attempts.- Returns:
- The delay between retry attempts
- Default:
"1s"
-
maxDelay
-
multiplier
Returns the multiplier to use to calculate the delay.- Returns:
- The multiplier to use to calculate the delay
- Default:
"1.0"
-
predicate
Class<? extends RetryPredicate> predicateReturns the retry predicate class to use instead ofincludes()andexcludes().- Returns:
- The retry predicate class to use instead of
includes()andexcludes()(defaults to none)
- Default:
io.micronaut.retry.annotation.DefaultRetryPredicate.class
-
capturedException
Returns the exception type that should be intercepted for retry handling.- Returns:
- The exception type that should be intercepted for retry handling. Once an exception is captured,
it is still evaluated by
includes(),excludes(), orpredicate()to decide whether to retry. Defaults toException.
- Default:
java.lang.Exception.class
-
jitter
Returns the jitter factor used to apply random deviation to retry delays.- Returns:
- The jitter factor used to apply random deviation to retry delays
- Default:
"0.0"
-