一、服务熔断
@HystrixCommand注解
name=”circuitBreaker.enabled”,value=”true”
name=”circuitBreaker.requestVolumeThreshold”,value=”10″ // 设置在一个滚动窗口中,打开断路器的最少请求数
name=”circuitBreaker.sleepWindowInMilliseconds”,value=”10000″ // 设置在回路被打开,拒绝请求到再次尝试请求并决定回路是否继续打开的时间
name=”circuitBreaker.errorThresholdPercentage”,value=”60″ // 错误率达到60%触发降级
参考:https://www.jianshu.com/p/397…
配置
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 2000
发表回复