2016-06-07 93 views
0

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

该应用程序基于一个弹簧栈(弹簧靴,执行器等)。

回答

0

您可以设置该属性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