This policy allows to switch to another backend or making the call fails with a 503 Service Unavailable
in case of errors or latency. It is possible to configure errors and latency threshold rate to open the circuit breaker.
Implementation is based on Resilience4j, you can find more information on their documentation.
It guaranties high availability making your system resilient if your target is detected as failing.
You can configure the policy with the following options:
Property | Required | Description | Type | Default |
---|---|---|---|---|
failureRateThreshold |
X |
Failure rate threshold before the circuit breaker switches to open state. A failure represents a response’s status code >= 500. The threshold is expressed as a percentage. |
integer (min. 0, max.100) |
50 |
slowCallRateThreshold |
X |
Slow call rate threshold before the circuit breaker switches to open state. A slow call is represented by a response time greater than the configured |
integer (min. 0, max.100) |
50 |
slowCallDurationThreshold |
X |
The duration threshold above which a call is considered as slow, increasing |
integer (min. 1) |
1000 |
windowSize |
X |
The size of the sliding window which is used to record the outcome of calls when the circuit is closed. |
integer (min. 0) |
100 |
waitDurationInOpenState |
The duration in millisecond before switching from open circuit to half-open. |
integer (min. 1) |
1000 |
|
redirectToURL |
Redirect the call to the given URL instead of returning '503 Service Unavailable' status (supports EL) |
string |
||
scope |
X |
Cached response can be set for a single consumer (application) or for all applications.<br><strong>WARNING:</strong> Please be aware that by using an \"API\" scope, data will be shared between all consumers ! |
API / APPLICATION |
APPLICATION |