Package io.smallrye.faulttolerance.api
Annotation Type CustomBackoff
@Inherited
@Documented
@Retention(RUNTIME)
@Target({METHOD,TYPE})
@Experimental("first attempt at providing additional retry backoff strategies")
public @interface CustomBackoff
Modifies a
@Retry annotation to use a custom backoff strategy instead of the default constant backoff.
May only be present on elements that are also annotated @Retry.
For each invocation of a method annotated @Retry, an instance of given CustomBackoffStrategy
is created and used for computing delays between individual retry attempts, including before the first retry.
All configuration options of @Retry still apply and all their constraints are still enforced.
Additionally:
delay,delayUnit: passed toCustomBackoffStrategy.init(long)as an initial delay. The strategy may ignore it if the concept of initial delay doesn't make sense.
- See Also:
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionClass<? extends CustomBackoffStrategy> Class of the custom backoff strategy that will be used to compute retry delays.
-
Element Details
-
value
Class<? extends CustomBackoffStrategy> valueClass of the custom backoff strategy that will be used to compute retry delays.- Returns:
- custom backoff strategy class
- See Also:
-