Interface RetryStrategyWithContent<T extends Response>
- Type Parameters:
T
- the response type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface RetryStrategyWithContent<T extends Response>
Determines whether a failed request should be retried using the content of a
Response
.
If you just need the headers to make a decision, use RetryStrategy
for efficiency.-
Method Summary
Modifier and Type Method Description CompletionStage<Backoff>
shouldRetry(ClientRequestContext ctx, T response)
Tells whether the request sent with the specifiedClientRequestContext
requires a retry or not.
-
Method Details
-
shouldRetry
Tells whether the request sent with the specifiedClientRequestContext
requires a retry or not. Implement this method to return aCompletionStage
and to complete it with a desiredBackoff
. To stop trying further, complete it withnull
.- Parameters:
ctx
- theClientRequestContext
of this requestresponse
- theResponse
from the server
-