SpringCloud------熔断降级的超时配置

官方文档:

https://github.com/Netflix/Hystrix/wiki/Configuration

1)execution.isolation.strategy          隔离策略

THREAD               线程池 (默认)       它在单独的线程上执行,并发请求受线程池中线程数的限制

SEMAPHORE       信号量                  它在调用线程上执行,并发请求受信号量限制

2)execution.isolation.thread.timeoutInMilliseconds        超时时间 (默认1000毫秒)

3)execution.timeout.enabled        是否开启超时限制 (推荐开启)

4)execution.isolation.semaphore.maxConcurrentRequests        

隔离策略为信号量时,如果达到最大并发数时,后续请求会被拒绝,默认是10

举例:

#hystrix熔断超时配置
hystrix:
  command:
    default:
      execution:
        #开启超时配置(默认为开启)
        timeout:
          enabled: true
        #设置超时时间
        isolation:
          thread:
            timeoutInMilliseconds: 4000

 

猜你喜欢

转载自www.cnblogs.com/tianhengblogs/p/12490136.html