码迷,mamicode.com
首页 > 其他好文 > 详细

hystrix动态修改参数

时间:2019-11-08 17:39:51      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:and   rcu   tle   for   public   ring   bool   log   http   

Hystrix 从入门到深入——运行时修改动态配置

/**
 * 
 * @author zhangshuo
 *
 */
@Component
public class DynamicConfigSource implements PolledConfigurationSource {
  private static final Logger logger = LoggerFactory.getLogger(DynamicConfigSource.class);

  @Override
  public PollResult poll(boolean initial, Object checkPoint) throws Exception {
    Map<String, Object> complete = new HashMap<String, Object>();

    /**
     * 配置中心配置了对应的key/value。其中commandKey是我指定的具体接口。
     */
    complete.put("hystrix.command.commandKey.circuitBreaker.forceOpen",
        “具体配置,比如来自配置中心”);

    logger.debug("poll:{}", complete);

    return PollResult.createFull(complete);
  }
}

  

hystrix动态修改参数

标签:and   rcu   tle   for   public   ring   bool   log   http   

原文地址:https://www.cnblogs.com/heroinss/p/11821750.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!