/**
 * 
 * @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);
  }
}

  

相关文章:

  • 2021-07-07
  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-01
猜你喜欢
  • 2021-09-04
  • 2022-02-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2021-08-29
相关资源
相似解决方案