【问题标题】:Hystrix runtime managementHystrix 运行时管理
【发布时间】:2016-10-07 19:34:53
【问题描述】:

有没有办法在应用程序运行期间控制 hystrix 电路的状态?我正在寻找一种解决方案来打开/关闭特定电路以进行测试。

该应用程序基于弹簧堆栈(弹簧引导、执行器等)。

【问题讨论】:

    标签: spring hystrix


    【解决方案1】:

    您可以设置属性 hystrix.command.HystrixCommandKey.circuitBreaker.forceClosed

    ConfigurationManager.getConfigInstance().setProperty("hystrix.command.HystrixCommandKey.circuitBreaker.forceClosed", true);

    如果该属性为真,则强制断路器进入闭合状态 无论错误百分比如何,它都会允许请求。

    circuitBreaker.forceOpen 属性优先,所以如果它被设置 为 true 这个属性什么都不做。

    您可以在此处查看更多 Hytrix 属性

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

    【讨论】:

      猜你喜欢
      • 2015-03-03
      • 2016-01-04
      • 2018-07-15
      • 2017-01-10
      • 2017-05-14
      • 2014-12-21
      • 2015-03-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多