Class RetryPolicy

    • Constructor Detail

      • RetryPolicy

        protected RetryPolicy​(String name)
    • Method Detail

      • isRetryableException

        public static boolean isRetryableException​(Exception exception)
      • incrementRetryCount

        public void incrementRetryCount​(String clientId)
      • resetRetryCount

        public void resetRetryCount​(String clientId)
      • getRetryCount

        protected int getRetryCount​(String clientId)
      • getNextRetryInterval

        public Duration getNextRetryInterval​(String clientId,
                                             Exception lastException,
                                             Duration remainingTime)
        Gets the Interval after which nextRetry should be done.
        Parameters:
        clientId - clientId
        lastException - lastException
        remainingTime - remainingTime to retry
        Returns:
        returns 'null' Duration when not Allowed
      • onGetNextRetryInterval

        protected abstract Duration onGetNextRetryInterval​(String clientId,
                                                           Exception lastException,
                                                           Duration remainingTime,
                                                           int baseWaitTime)