Interface CircuitBreakerStrategyWithContent<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 CircuitBreakerStrategyWithContent<T extends Response>
Determines whether a
Response
should be reported as a success or a failure to a
CircuitBreaker
using the content of a Response
. If you just need the HTTP headers
to make a decision, use CircuitBreakerStrategy
for efficiency.-
Method Summary
Modifier and Type Method Description CompletionStage<Boolean>
shouldReportAsSuccess(ClientRequestContext ctx, T response)
-
Method Details
-
shouldReportAsSuccess
Returns aCompletionStage
that containstrue
,false
ornull
according to the specifiedResponse
. Iftrue
is returned,CircuitBreaker.onSuccess()
is called so that theCircuitBreaker
increases its success count and uses it to make a decision to close or open the circuit. Iffalse
is returned, it works the other way around. Ifnull
is returned, theCircuitBreaker
ignores it.- Parameters:
ctx
- theClientRequestContext
of this requestresponse
- theResponse
from the server
-