Class LoadBalancerRetryContext


  • public class LoadBalancerRetryContext
    extends Object
    Stores the data for a load-balanced call that is being retried.
    Since:
    3.0.0
    Author:
    Olga Maciaszek-Sharma
    • Constructor Detail

      • LoadBalancerRetryContext

        protected LoadBalancerRetryContext​(org.springframework.web.reactive.function.client.ClientRequest request)
    • Method Detail

      • getRequest

        protected org.springframework.web.reactive.function.client.ClientRequest getRequest()
        Returns the ClientRequest that is being load-balanced.
        Returns:
        the request that is being load-balanced.
      • getClientResponse

        protected org.springframework.web.reactive.function.client.ClientResponse getClientResponse()
        Returns the ClientResponse returned for load-balanced request.
        Returns:
        the response for the load-balanced request.
      • setClientResponse

        protected void setClientResponse​(org.springframework.web.reactive.function.client.ClientResponse clientResponse)
        Sets the ClientResponse returned for load-balanced request.
        Parameters:
        clientResponse - the response for the load-balanced request.
      • getRetriesSameServiceInstance

        protected Integer getRetriesSameServiceInstance()
        Returns the number of times a load-balanced request should be retried on the same ServiceInstance.
        Returns:
        the number of retries
      • incrementRetriesSameServiceInstance

        protected void incrementRetriesSameServiceInstance()
        Increments the counter for the retries executed against the same ServiceInstance.
      • resetRetriesSameServiceInstance

        protected void resetRetriesSameServiceInstance()
        Resets the counter for the retries executed against the same ServiceInstance.
      • getRetriesNextServiceInstance

        protected Integer getRetriesNextServiceInstance()
        Returns the number of times a load-balanced request should be retried on the next ServiceInstance.
        Returns:
        the number of retries
      • incrementRetriesNextServiceInstance

        protected void incrementRetriesNextServiceInstance()
        Increments the counter for the retries executed against the same ServiceInstance.
      • getResponseStatusCode

        protected Integer getResponseStatusCode()
        Returns the status code from the ClientResponse returned for load-balanced request.
        Returns:
        the status code from the response for the load-balanced request.
      • getRequestMethod

        protected org.springframework.http.HttpMethod getRequestMethod()
        Returns the HttpMethod of the ClientRequest that is being load-balanced.
        Returns:
        the HTTP method of the request that is being load-balanced.