Interface RetryCallback<T,E extends Throwable>

Type Parameters:
T - the type of object returned by the callback
E - the type of exception it declares may be thrown
All Known Implementing Classes:
MethodInvocationRetryCallback

public interface RetryCallback<T,E extends Throwable>
Callback interface for an operation that can be retried using a RetryOperations.
Author:
Rob Harrop, Dave Syer, Artem Bilan
  • Method Summary

    Modifier and Type
    Method
    Description
    Execute an operation with retry semantics.
    default String
    A logical identifier for this callback to distinguish retries around business operations.
  • Method Details

    • doWithRetry

      T doWithRetry(RetryContext context) throws E
      Execute an operation with retry semantics. Operations should generally be idempotent, but implementations may choose to implement compensation semantics when an operation is retried.
      Parameters:
      context - the current retry context.
      Returns:
      the result of the successful operation.
      Throws:
      E - of type E if processing fails
    • getLabel

      default String getLabel()
      A logical identifier for this callback to distinguish retries around business operations.
      Returns:
      the identifier for this callback.
      Since:
      2.0.6