【发布时间】:2017-05-29 16:24:38
【问题描述】:
我想将方法注释中的以下配置移动到属性文件中
@HystrixCommand(commandProperties = {
@HystrixProperty(name = "circuitBreaker.sleepWindowInMilliseconds", value = "10000"),
@HystrixProperty(name = "metrics.rollingStats.timeInMilliseconds", value = "10000"),
@HystrixProperty(name = "circuitBreaker.requestVolumeThreshold", value = "5"),
@HystrixProperty(name = "circuitBreaker.errorThresholdPercentage", value = "100")
},
fallbackMethod = "fallbackCall")
我已将 application.yml 文件放在 src/main/resources 下
hystrix:
command.:
getResult:
circuitBreaker:
sleepWindowInMilliseconds: 10000
errorThresholdPercentage: 100
requestVolumeThreshold: 5
metrics:
rollingStats:
timeInMilliseconds: 10000
我没有使用弹簧靴。 Hystrix 没有获取此文件。
是否需要进行任何配置才能将 application.yml 传递给 hystrix 配置?
【问题讨论】:
标签: spring-cloud hystrix netflix spring-cloud-netflix