Interface InterceptorChain

    • Method Detail

      • retry

        <Req,​Res> Res retry​(RequestSpec<Req,​Res> request)
                           throws RocketRestException
        Retries the request from the beginning of the chain.

        This increments the retry count and re-executes the full interceptor chain, including all beforeRequest/afterResponse hooks.

        Type Parameters:
        Req - The request body type
        Res - The response type
        Parameters:
        request - The request to retry (can be modified from original)
        Returns:
        The response from the retried request
        Throws:
        RocketRestException - If the retry also fails
      • getRetryCount

        int getRetryCount()
        Gets the current retry count for this execution.

        Starts at 0 for the initial request, increments with each retry. Use this to implement retry limits.

        Returns:
        The number of retries attempted so far
      • getMaxRetries

        int getMaxRetries()
        Gets the maximum retry count configured for this chain.

        Returns 0 if no retry limit is configured.

        Returns:
        The maximum retry count, or 0 if unlimited