【问题标题】:Hystrix method deprecated不推荐使用 Hystrix 方法
【发布时间】:2016-08-10 06:31:26
【问题描述】:

我正在使用 hystrix api 版本 1.5.4。我看到 withExecutionIsolationThreadTimeoutInMilliseconds 方法已被弃用。替代方法是什么?

    public HystrixHelloCommand(String message) {
    super(HystrixCommand.Setter.withGroupKey(HystrixCommandGroupKey.Factory.asKey("MyGroup")).andCommandPropertiesDefaults(
     HystrixCommandProperties.Setter()
    .withCircuitBreakerEnabled(true).withExecutionIsolationThreadTimeoutInMilliseconds(2000)));
}

【问题讨论】:

    标签: netflix hystrix spring-cloud-netflix


    【解决方案1】:

    根据Doc,它被withExecutionTimeoutInMilliseconds 取代,这就是它所说的:

    com.netflix.hystrix.HystrixCommandProperties.Setter.withExecutionIsolationThreadTimeoutInMilliseconds(int) 从 1.4.0 开始,替换为 HystrixCommandProperties.Setter.withExecutionTimeoutInMilliseconds(int)。 超时不再仅适用于线程隔离的命令,因此 特定于线程的名称具有误导性

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-13
      • 2014-05-05
      • 2012-02-22
      • 2011-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多