Skip to main content
Feedback

Circuit Breaker Policy

With the Circuit Breaker policy, you can define failure thresholds. When the threshold is met, you can redirect or fail with a 503 Service Unavailable error.

note

If the Circuit Breaker policy is applied to an API, it takes precedence and the max retry attempts configured in execution settings are ignored.

Timing

On RequestOn Response
X

Configuration

PropertyRequiredDescriptionTypeDefault
failureRateThresholdyesFailure rate threshold before the circuit breaker switches to open state. A failure represents a response status code greater than or equal to 500. The threshold is expressed as a percentage.integer (minimum 0, maximum 100)50
slowCallRateThresholdyesSlow call rate threshold before the circuit breaker switches to open state. A slow call is represented by a response time greater than the configured slowCallDurationThreshold. The threshold is expressed as a percentage.integer (min. 0, max.100)50
slowCallDurationThresholdyesThe duration threshold above which a call is considered as slow, increasing slowCallRateThreshold. The duration is expressed in milliseconds.integer (minimum 1)1000
windowSizeyesThe size of the sliding window which that records the outcome of calls when the circuit is closed.integer(minimum >0)100
waitDurationInOpenStateyesThe duration in milliseconds before switching from open circuit to half-open.integer (minimum 1)1000
redirectToURLnoRedirect the call to the given URL instead of returning 503 Service Unavailable status (supports Expression Language)string
headersnoAppend additional headers to the redirect request.array

Example

{
"failureRateThreshold": 50,
"slowCallRateThreshold": 50,
"slowCallDurationThreshold": 1000,
"windowSize": 100,
"waitDurationInOpenState": 1000,
"redirectToURL": "",
"headers": [
{
"name": "Content-Type",
"value": "application/json"
}
]
}
On this Page