Interface RetryDeterminer<X extends Exception>

  • Type Parameters:
    X - The type of exception you are checking and could possibly return.
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface RetryDeterminer<X extends Exception>
    This abstract class is designed to tell if an exception is transient and should result in a retry or not, and should result in a returned exception to the caller. Meant to be used with a ResilientOperation.
    • Method Detail

      • shouldRetry

        boolean shouldRetry​(X e)
        Determines if we should attempt a retry depending on the caught exception.

        To indicate that no retry should be made, return false. If no retry, the exception should be returned to the user.

        Parameters:
        e - Exception of type X that can be examined to determine if a retry is possible.
        Returns:
        true if should retry, false otherwise