Hystrix运行时管理

时间:2016-06-07 18:53:10

标签: spring hystrix

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

该应用程序基于弹簧组(弹簧套,执行器等)。

1 个答案:

答案 0 :(得分:0)

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

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

  

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

     

circuitBreaker.forceOpen属性优先,如果设置的话   如果这个属性什么都不做。

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

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