并发测试失败,日志显示:
com.netflix.hystrix.exception.HystrixRuntimeException:社区服务无法获取用于执行的信号量,并且没有可用的回退。
我读了源代码。它似乎是由executionIsolationSemaphoreMaxConcurrentRequests.控制的
我的问题是如何提高executionIsolationSemaphoreMaxConcurrentRequests?
发布于 2016-07-07 09:01:54
如果您使用的是Setter,则可以
public class HystrixCommandInstance extends HystrixCommand<>
public HystrixCommandInstance() {
super(Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("SomeGroupName"))
.andCommandPropertiesDefaults(HystrixCommandProperties.Setter()
.withExecutionIsolationSemaphoreMaxConcurrentRequests(200)));
}
}发布于 2015-10-15 15:52:31
如果使用的是@HystrixCommand注释,则可以指定commandProperties()来配置命令。
@HystrixCommand(fallbackMethod = "fallbackMethod",
commandProperties = {
@HystrixProperty(name = "execution.isolation.semaphore.maxConcurrentRequests", value = "15")
})https://stackoverflow.com/questions/33094183
复制相似问题