0
点赞
收藏
分享

微信扫一扫

动态修改hystrix配置项

Hystrix默认使用​​Archaius​​来实现的动态配置,下面是一个Command的实现:

动态修改hystrix配置项_加载

Archaius 默认支持两种方式来加载本地的配置文件:

  1. 默认情况下,Archaius默认会加载classpath下的config.properties文件
  2. 在程序启动的时候,加如下的启动参数:-Darchaius.configurationSource.additionalUrls=file:///apps/myapp/application.properties

注:在代码中动态修改配置项的值,是无效的。

Hystrix支持的动态配置列表如下:

官网:​​https://github.com/Netflix/Hystrix/wiki/Configuration​​

​​Command Properties​​

  1. ​​Execution​​
  1. ​​execution.isolation.strategy​​
  2. ​​execution.isolation.thread.timeoutInMilliseconds​​
  3. ​​execution.timeout.enabled​​
  4. ​​execution.isolation.thread.interruptOnTimeout​​
  5. ​​execution.isolation.thread.interruptOnCancel​​
  6. ​​execution.isolation.semaphore.maxConcurrentRequests​​
  1. ​​Fallback​​
  1. ​​fallback.isolation.semaphore.maxConcurrentRequests​​
  2. ​​fallback.enabled​​
  1. ​​Circuit Breaker​​
  1. ​​circuitBreaker.enabled​​
  2. ​​circuitBreaker.requestVolumeThreshold​​
  3. ​​circuitBreaker.sleepWindowInMilliseconds​​
  4. ​​circuitBreaker.errorThresholdPercentage​​
  5. ​​circuitBreaker.forceOpen​​
  6. ​​circuitBreaker.forceClosed​​
  1. ​​Metrics​​
  1. ​​metrics.rollingStats.timeInMilliseconds​​
  2. ​​metrics.rollingStats.numBuckets​​
  3. ​​metrics.rollingPercentile.enabled​​
  4. ​​metrics.rollingPercentile.timeInMilliseconds​​
  5. ​​metrics.rollingPercentile.numBuckets​​
  6. ​​metrics.rollingPercentile.bucketSize​​
  7. ​​metrics.healthSnapshot.intervalInMilliseconds​​
  1. ​​Request Context​​
  1. ​​requestCache.enabled​​
  2. ​​requestLog.enabled​​

​​Collapser Properties​​

  1. ​​maxRequestsInBatch​​
  2. ​​timerDelayInMilliseconds​​
  3. ​​requestCache.enabled​​

​​Thread Pool Properties​​

  1. ​​coreSize​​
  2. ​​maximumSize​​
  3. ​​maxQueueSize​​
  4. ​​queueSizeRejectionThreshold​​
  5. ​​keepAliveTimeMinutes​​
  6. ​​allowMaximumSizeToDivergeFromCoreSize​​
  7. ​​metrics.rollingStats.timeInMilliseconds​​
  8. ​​metrics.rollingStats.numBuckets​​


举报

相关推荐

0 条评论