【发布时间】:2018-01-14 18:27:30
【问题描述】:
我们在应用中添加了一些外部系统。我们正在使用 Hystrix 命令使用 apache http 客户端库执行远程 REST 调用。
我们遇到了这样一个问题,即对于一个外部服务器电路始终打开并且我们获得默认回退。减少睡眠窗口并没有真正的帮助
public Command(CloseableHttpClient httpClient, HttpRequestBase httpRequest) {
super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("MyServer"))
.andThreadPoolKey(HystrixThreadPoolKey.Factory
.asKey(ServerManager.WorkManager.name())));
ConfigurationManager.getConfigInstance().setProperty(
"hystrix.command.Command.execution.isolation.thread.timeoutInMilliseconds",
getExecutionTimeout());
ConfigurationManager.getConfigInstance().setProperty(
"hystrix.command.Commad.circuitBreaker.sleepWindowInMilliseconds",
getIgnoreTimeout());
this.httpRequest = httpRequest;
this.httpClient = httpClient;
}
对于其他系统,断路器按预期工作。 即使断路器似乎已打开,也尝试重新启动应用程序服务器。
是否存在边缘情况或其他情况?还是 Hystrix 命令应该以不同的方式处理?
【问题讨论】: