public static final class CreateCircuitBreakerRuleRequest.Builder extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
CreateCircuitBreakerRuleRequest.Builder |
acceptLanguage(String acceptLanguage)
The language of the response.
|
CreateCircuitBreakerRuleRequest.Builder |
appId(String appId)
The ID of the application.
|
CreateCircuitBreakerRuleRequest.Builder |
appName(String appName)
The application name.
|
CreateCircuitBreakerRuleRequest |
build() |
CreateCircuitBreakerRuleRequest.Builder |
enable(Boolean enable)
Specifies whether to enable the rule.
|
CreateCircuitBreakerRuleRequest.Builder |
halfOpenBaseAmountPerStep(Integer halfOpenBaseAmountPerStep)
The minimum number of requests that can be passed in each step after circuit breaking recovers.
|
CreateCircuitBreakerRuleRequest.Builder |
halfOpenRecoveryStepNum(Integer halfOpenRecoveryStepNum)
The number of circuit breaking recovery steps.
|
CreateCircuitBreakerRuleRequest.Builder |
maxAllowedRtMs(Integer maxAllowedRtMs)
The maximum response time (RT).
|
CreateCircuitBreakerRuleRequest.Builder |
minRequestAmount(Integer minRequestAmount)
The minimum number of requests to trigger circuit breaking.
|
CreateCircuitBreakerRuleRequest.Builder |
namespace(String namespace)
The microservice namespace to which the application belongs.
|
CreateCircuitBreakerRuleRequest.Builder |
regionId(String regionId)
The region in which the instance resides.
|
CreateCircuitBreakerRuleRequest.Builder |
resource(String resource)
The name of the interface to which the rule applies.
|
CreateCircuitBreakerRuleRequest.Builder |
resourceType(Integer resourceType)
The resource type.
|
CreateCircuitBreakerRuleRequest.Builder |
retryTimeoutMs(Integer retryTimeoutMs)
The period in which circuit breaking is implemented.
|
CreateCircuitBreakerRuleRequest.Builder |
statIntervalMs(Integer statIntervalMs)
The length of the time window.
|
CreateCircuitBreakerRuleRequest.Builder |
strategy(Integer strategy)
The threshold type.
|
CreateCircuitBreakerRuleRequest.Builder |
threshold(Float threshold)
A percentage threshold for triggering circuit breaking.
|
public CreateCircuitBreakerRuleRequest.Builder acceptLanguage(String acceptLanguage)
The language of the response. Valid values:
zh
public CreateCircuitBreakerRuleRequest.Builder appId(String appId)
The ID of the application.
example:hkhon1po62@c3df23522bXXXXX
public CreateCircuitBreakerRuleRequest.Builder appName(String appName)
The application name.
This parameter is required.
example:spring-cloud-a
public CreateCircuitBreakerRuleRequest.Builder enable(Boolean enable)
Specifies whether to enable the rule.
Valid values:
true
false
This parameter is required.
example:true
public CreateCircuitBreakerRuleRequest.Builder halfOpenBaseAmountPerStep(Integer halfOpenBaseAmountPerStep)
The minimum number of requests that can be passed in each step after circuit breaking recovers. Default value: 1.
example:5
public CreateCircuitBreakerRuleRequest.Builder halfOpenRecoveryStepNum(Integer halfOpenRecoveryStepNum)
The number of circuit breaking recovery steps. Default value: 1.
example:1
public CreateCircuitBreakerRuleRequest.Builder maxAllowedRtMs(Integer maxAllowedRtMs)
The maximum response time (RT). Unit: milliseconds. If the RT of a request is greater than the value of this parameter, a slow call is counted. If you set Strategy to 0, you must specify this parameter.
example:200
public CreateCircuitBreakerRuleRequest.Builder minRequestAmount(Integer minRequestAmount)
The minimum number of requests to trigger circuit breaking. If the number of requests in the current time window is less than the value of this parameter, circuit breaking is not triggered even if the circuit breaking rule is met. Default value: 10.
example:10
public CreateCircuitBreakerRuleRequest.Builder namespace(String namespace)
The microservice namespace to which the application belongs.
This parameter is required.
example:default
public CreateCircuitBreakerRuleRequest.Builder regionId(String regionId)
The region in which the instance resides.
example:cn-hangzhou
public CreateCircuitBreakerRuleRequest.Builder resource(String resource)
The name of the interface to which the rule applies. The interface name must be the same as the name on the interface details page in the console.
This parameter is required.
example:/a
public CreateCircuitBreakerRuleRequest.Builder resourceType(Integer resourceType)
The resource type.
Valid values:
0
public CreateCircuitBreakerRuleRequest.Builder retryTimeoutMs(Integer retryTimeoutMs)
The period in which circuit breaking is implemented. Unit: milliseconds. If circuit breaking is implemented on the requests for the route, the calls to all the requests for the route fail in the configured circuit breaking period. The value must be an integral multiple of 1,000. Default value: 10000. This value indicates 10 seconds.
example:10000
public CreateCircuitBreakerRuleRequest.Builder statIntervalMs(Integer statIntervalMs)
The length of the time window. Unit: milliseconds. The valid range is from 1 second to 120 minutes. The default value is 20000. This value indicates 20 seconds.
example:20000
public CreateCircuitBreakerRuleRequest.Builder strategy(Integer strategy)
The threshold type.
Valid values:
0
:
slow call proportion
1
:
abnormal proportion
This parameter is required.
example:0
public CreateCircuitBreakerRuleRequest.Builder threshold(Float threshold)
A percentage threshold for triggering circuit breaking. Valid values: 0-1. These values represent 0% to 100%.
This parameter is required.
example:0.8
public CreateCircuitBreakerRuleRequest build()
Copyright © 2026. All rights reserved.