1.编写代码

Hystrix参数配置

2.配置文件application.properties

hystrix.command.default.execution.isolation.strategy THREAD\SEMAPHORE 通过线程池隔离服务
hystrix.command.default.execution.isolation.thread.tiemoutInMilliseconds 1000 超时时间
hystrix.command.default.circuitBreaker.enabled true 是否启用断路器
hystrix.command.default.circuitBreaker.requestVolumeThreshold 20 断路最小请求量
hystrix.command.default.circuitBreaker.errorThreadholdPercentage 50 断路最小错误率
hystrix.command.default.metrics.rollingStats.timeInMIlliseconds 10000 断路最小时间
hystrix.command.default.circuitBreaker.sleepWindowInMilliseconds 5000 断路器打开多久后处于半开状态
hystrix.command.default.requestCache.enabled true 是否启用请求缓存
hystrix.command.default.coreSize 10 线程池核心线程数
hystrix.threadpool.default.maxQueueSize 1 核心线程数
hystrix.threadpool.default.queueSizeRejectionThreshold 5 队列动态变化大小
3.同consul的key-value(Archaius)实现动态配置

相关文章:

  • 2021-05-25
  • 2022-02-09
  • 2021-08-18
  • 2022-12-23
  • 2021-08-09
  • 2022-12-23
  • 2021-06-03
  • 2021-04-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
  • 2021-07-24
相关资源
相似解决方案