CircuitBreakerPolicy Class
- java.
lang. Object - com.
azure. resourcemanager. appcontainers. models. CircuitBreakerPolicy
- com.
Implements
public final class CircuitBreakerPolicy
implements JsonSerializable<CircuitBreakerPolicy>
Policy that defines circuit breaker conditions.
Constructor Summary
| Constructor | Description |
|---|---|
| CircuitBreakerPolicy() |
Creates an instance of Circuit |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| Integer |
consecutiveErrors()
Get the consecutive |
|
static
Circuit |
fromJson(JsonReader jsonReader)
Reads an instance of Circuit |
| Integer |
intervalInSeconds()
Get the interval |
| Integer |
maxEjectionPercent()
Get the max |
|
Json |
toJson(JsonWriter jsonWriter) |
| void |
validate()
Validates the instance. |
|
Circuit |
withConsecutiveErrors(Integer consecutiveErrors)
Set the consecutive |
|
Circuit |
withIntervalInSeconds(Integer intervalInSeconds)
Set the interval |
|
Circuit |
withMaxEjectionPercent(Integer maxEjectionPercent)
Set the max |
Methods inherited from java.lang.Object
Constructor Details
CircuitBreakerPolicy
public CircuitBreakerPolicy()
Creates an instance of CircuitBreakerPolicy class.
Method Details
consecutiveErrors
public Integer consecutiveErrors()
Get the consecutiveErrors property: Number of consecutive errors before the circuit breaker opens.
Returns:
fromJson
public static CircuitBreakerPolicy fromJson(JsonReader jsonReader)
Reads an instance of CircuitBreakerPolicy from the JsonReader.
Parameters:
Returns:
Throws:
intervalInSeconds
public Integer intervalInSeconds()
Get the intervalInSeconds property: The time interval, in seconds, between endpoint checks. This can result in opening the circuit breaker if the check fails as well as closing the circuit breaker if the check succeeds. Defaults to 10s.
Returns:
maxEjectionPercent
public Integer maxEjectionPercent()
Get the maxEjectionPercent property: Maximum percentage of hosts that will be ejected after failure threshold has been met.
Returns:
toJson
validate
public void validate()
Validates the instance.
withConsecutiveErrors
public CircuitBreakerPolicy withConsecutiveErrors(Integer consecutiveErrors)
Set the consecutiveErrors property: Number of consecutive errors before the circuit breaker opens.
Parameters:
Returns:
withIntervalInSeconds
public CircuitBreakerPolicy withIntervalInSeconds(Integer intervalInSeconds)
Set the intervalInSeconds property: The time interval, in seconds, between endpoint checks. This can result in opening the circuit breaker if the check fails as well as closing the circuit breaker if the check succeeds. Defaults to 10s.
Parameters:
Returns:
withMaxEjectionPercent
public CircuitBreakerPolicy withMaxEjectionPercent(Integer maxEjectionPercent)
Set the maxEjectionPercent property: Maximum percentage of hosts that will be ejected after failure threshold has been met.
Parameters:
Returns: