Annotation Type BeforeRetry


@Inherited @Documented @Retention(RUNTIME) @Target({METHOD,TYPE}) @Experimental("first attempt at providing before retry actions") public @interface BeforeRetry
Defines a handler or method that should be called before any retry, but not before the initial attempt. May only be present on elements that are also annotated @Retry.

The before retry action must be fast and non-blocking (i.e., it must not do any IO or long-running computations) and must not throw an exception.

Only one of value() and methodName() can be specified. If both of them are, deployment problem occurs.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies the name of the method to call before each retry.
    Specify the before retry handler class to be used.
  • Element Details

    • value

      Class<? extends BeforeRetryHandler> value
      Specify the before retry handler class to be used. A new instance of the handler class is created for each retry.
      Returns:
      the before retry handler class
      Default:
      io.smallrye.faulttolerance.api.BeforeRetry.DEFAULT.class
    • methodName

      String methodName
      Specifies the name of the method to call before each retry. This method belongs to the same class as the method that is being retried. The method must have no parameters and return void.
      Returns:
      the method to call before each retry
      Default:
      ""