Class LoadBalancerRetryContext
- java.lang.Object
-
- org.springframework.cloud.client.loadbalancer.reactive.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 Summary
Constructors Modifier Constructor Description protectedLoadBalancerRetryContext(org.springframework.web.reactive.function.client.ClientRequest request)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.springframework.web.reactive.function.client.ClientResponsegetClientResponse()Returns theClientResponsereturned for load-balanced request.protected org.springframework.web.reactive.function.client.ClientRequestgetRequest()Returns theClientRequestthat is being load-balanced.protected org.springframework.http.HttpMethodgetRequestMethod()Returns theHttpMethodof theClientRequestthat is being load-balanced.protected IntegergetResponseStatusCode()Returns the status code from theClientResponsereturned for load-balanced request.protected IntegergetRetriesNextServiceInstance()Returns the number of times a load-balanced request should be retried on the nextServiceInstance.protected IntegergetRetriesSameServiceInstance()Returns the number of times a load-balanced request should be retried on the sameServiceInstance.protected voidincrementRetriesNextServiceInstance()Increments the counter for the retries executed against the sameServiceInstance.protected voidincrementRetriesSameServiceInstance()Increments the counter for the retries executed against the sameServiceInstance.protected voidresetRetriesSameServiceInstance()Resets the counter for the retries executed against the sameServiceInstance.protected voidsetClientResponse(org.springframework.web.reactive.function.client.ClientResponse clientResponse)Sets theClientResponsereturned for load-balanced request.
-
-
-
Method Detail
-
getRequest
protected org.springframework.web.reactive.function.client.ClientRequest getRequest()
Returns theClientRequestthat is being load-balanced.- Returns:
- the request that is being load-balanced.
-
getClientResponse
protected org.springframework.web.reactive.function.client.ClientResponse getClientResponse()
Returns theClientResponsereturned 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 theClientResponsereturned 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 sameServiceInstance.- Returns:
- the number of retries
-
incrementRetriesSameServiceInstance
protected void incrementRetriesSameServiceInstance()
Increments the counter for the retries executed against the sameServiceInstance.
-
resetRetriesSameServiceInstance
protected void resetRetriesSameServiceInstance()
Resets the counter for the retries executed against the sameServiceInstance.
-
getRetriesNextServiceInstance
protected Integer getRetriesNextServiceInstance()
Returns the number of times a load-balanced request should be retried on the nextServiceInstance.- Returns:
- the number of retries
-
incrementRetriesNextServiceInstance
protected void incrementRetriesNextServiceInstance()
Increments the counter for the retries executed against the sameServiceInstance.
-
getResponseStatusCode
protected Integer getResponseStatusCode()
Returns the status code from theClientResponsereturned for load-balanced request.- Returns:
- the status code from the response for the load-balanced request.
-
getRequestMethod
protected org.springframework.http.HttpMethod getRequestMethod()
Returns theHttpMethodof theClientRequestthat is being load-balanced.- Returns:
- the HTTP method of the request that is being load-balanced.
-
-