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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The maximum integral digits for retry attempts validation.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    @Digits(integer=4,fraction=0) String
    Returns the maximum number of retry attempts.
    Class<? extends Throwable>
    Returns the exception type that should be intercepted for retry handling.
    Returns the delay between retry attempts.
    Class<? extends Throwable>[]
    Returns the exception types to exclude, which defaults to none.
    Class<? extends Throwable>[]
    Returns the exception types to include, which defaults to all.
    @Digits(integer=1,fraction=2) String
    Returns the jitter factor used to apply random deviation to retry delays.
    Returns the maximum overall delay.
    @Digits(integer=2,fraction=2) String
    Returns the multiplier to use to calculate the delay.
    Returns the retry predicate class to use instead of includes() and excludes().
    Class<? extends Throwable>[]
    Returns the exception types to include, which defaults to all.
  • Field Details

    • MAX_INTEGRAL_DIGITS

      static final int MAX_INTEGRAL_DIGITS
      The maximum integral digits for retry attempts validation.
      See Also:
  • Element Details

    • value

      @AliasFor(member="includes") Class<? extends Throwable>[] value
      Returns the exception types to include, which defaults to all.
      Returns:
      The exception types to include (defaults to all)
      Default:
      {}
    • includes

      Class<? extends Throwable>[] includes
      Returns the exception types to include, which defaults to all.
      Returns:
      The exception types to include (defaults to all)
      Default:
      {}
    • excludes

      Class<? extends Throwable>[] excludes
      Returns the exception types to exclude, which defaults to none.
      Returns:
      The exception types to exclude (defaults to none)
      Default:
      {}
    • attempts

      @Digits(integer=4, fraction=0) @Digits(integer=4,fraction=0) String attempts
      Returns the maximum number of retry attempts.
      Returns:
      The maximum number of retry attempts
      Default:
      "3"
    • delay

      String delay
      Returns the delay between retry attempts.
      Returns:
      The delay between retry attempts
      Default:
      "1s"
    • maxDelay

      String maxDelay
      Returns the maximum overall delay.
      Returns:
      The maximum overall delay
      Default:
      ""
    • multiplier

      @Digits(integer=2, fraction=2) @Digits(integer=2,fraction=2) String 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> predicate
      Returns the retry predicate class to use instead of includes() and excludes().
      Returns:
      The retry predicate class to use instead of includes() and excludes() (defaults to none)
      Default:
      io.micronaut.retry.annotation.DefaultRetryPredicate.class
    • capturedException

      Class<? extends Throwable> 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(), or predicate() to decide whether to retry. Defaults to Exception.
      Default:
      java.lang.Exception.class
    • jitter

      @Digits(integer=1, fraction=2) @Digits(integer=1,fraction=2) String 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"