Class RetryableAction<T>


  • public final class RetryableAction<T>
    extends Object
    Utility to repeatedly invoke an action that returns a result until it succeeds or the max allowed attempts is reached. All Exceptions except for those wrapped in NonRetryableException are retried. Only errors wrapped in RetryableError are retried.
    • Method Detail

      • doRetryableAction

        public static <T> T doRetryableAction​(Callable<T> callable,
                                              RetryableParams params)
                                       throws Exception
        Static method to repeatedly call action until it succeeds or the max allowed attempts is reached.
        Parameters:
        callable - Callable implementing assertion logic
        params - Retry related parameters
        Returns:
        Successful result
        Throws:
        Exception