Module methanol

Interface RetryInterceptor.Listener

  • Enclosing class:
    RetryInterceptor

    public static interface RetryInterceptor.Listener
    A listener for RetryInterceptor events. Useful for logging, metrics collection, and monitoring retry behavior.
    • Method Detail

      • onFirstAttempt

        default void onFirstAttempt​(java.net.http.HttpRequest request)
        Called when the interceptor is about to send the request for the first time.
      • onRetry

        default void onRetry​(RetryInterceptor.Context<?> context,
                             java.net.http.HttpRequest nextRequest,
                             java.time.Duration delay)
        Called when the interceptor is about to retry a request. The given context specifies the retryable state. The given request and delay specify the next request to send (after any request modification) and how long to wait before sending it, respectively.
      • onComplete

        default void onComplete​(RetryInterceptor.Context<?> context)
        Called when the interceptor is about to return the given state as-is because no retry condition matches.