我的local.properties文件hystrix属性如下所示。
hystrix.command.FASTSearchPageCommand.execution.isolation.strategy=THREAD
hystrix.command.FASTSearchPageCommand.execution.isolation.semaphore.maxConcurrentRequests=10
hystrix.command.FASTSearchPageCommand.execution.isolation.thread.timeoutInMilliseconds=1000
hystrix.command.FASTSearchPageCommand.execution.timeout.disabled=true
hystrix.command.FASTSearchPageCommand.execution.timeout.enabled=false
hystrix.command.FASTSearchPageCommand.execution.isolation.thread.interruptOnTimeout=true
hystrix.command.FASTSearchPageCommand.fallback.isolation.semaphore.maxConcurrentRequests=10
hystrix.command.FASTSearchPageCommand.fallback.disabled=false
hystrix.command.FASTSearchPageCommand.fallback.enabled=true
hystrix.command.FASTSearchPageCommand.circuitBreaker.disabled=false
hystrix.command.FASTSearchPageCommand.circuitBreaker.enabled=true
hystrix.command.FASTSearchPageCommand.circuitBreaker.requestVolumeThreshold=10
hystrix.command.FASTSearchPageCommand.circuitBreaker.sleepWindowInMilliseconds=8000
hystrix.command.FASTSearchPageCommand.circuitBreaker.errorThresholdPercentage=10
hystrix.command.FASTSearchPageCommand.circuitBreaker.forceOpen=false
hystrix.command.FASTSearchPageCommand.circuitBreaker.forceClosed=false
hystrix.command.FASTSearchPageCommand.metrics.rollingStats.timeInMilliseconds=1000
hystrix.command.FASTSearchPageCommand.metrics.rollingStats.numBuckets=5
hystrix.command.FASTSearchPageCommand.metrics.rollingPercentile.enabled=true
hystrix.command.FASTSearchPageCommand.metrics.rollingPercentile.timeInMilliseconds=100
hystrix.command.FASTSearchPageCommand.metrics.rollingPercentile.bucketSize=10
hystrix.command.FASTSearchPageCommand.metrics.healthSnapshot.intervalInMilliseconds=100
fastSearch.executionTimeout=5000那么我如何检查所有的都在工作呢?
发布于 2017-06-06 19:59:56
我想你可以在这里找到所有的文档:Hystrix docs
取自他们的文档的示例如下:
public class CommandThatFailsSilently extends HystrixCommand<String> {
private final boolean throwException;
public CommandThatFailsSilently(boolean throwException) {
super(HystrixCommandGroupKey.Factory.asKey("FASTSearchPageCommand"));
this.throwException = throwException;
}
@Override
protected String run() {
if (throwException) {
throw new RuntimeException("failure from CommandThatFailsFast");
} else {
return "success";
}
}
@Override
protected String getFallback() {
return null;
}
}https://stackoverflow.com/questions/44388104
复制相似问题