【问题标题】:Feign - Hystrix - feign.RetryableException: Connection refused: no further information executing GETFeign - Hystrix - feign.RetryableException:连接被拒绝:没有更多信息执行 GET
【发布时间】:2021-10-30 23:11:27
【问题描述】:

我有

@FeignClient(name="verbservice", fallback = VerbClientFallback.class)
public interface VerbClient {
    @GetMapping
    public String getVerbWord();
}

@Component
public class VerbClientFallback implements VerbClient {
    @Override
    public String getVerbWord() {
        return "fallback";
    }
}

应用程序

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableHystrix
public class SentenceAppApplication {
...}

控制器

@Autowired
private VerbClient verbClient;
....
return verbClient.getVerbWord() + ....other;

application.properties

feign.hystrix.enabled=true

版本

春季启动 2.5.4

<properties>
    <java.version>11</java.version>
    <spring-cloud.version>2020.0.3</spring-cloud.version>
</properties>

目标:停止动词服务,看看是否调用了回退。

问题:

嵌套异常是 feign.RetryableException: Connection denied: no 更多信息执行 GET http://verbservice] 的根本原因

我尝试了此链接中的步骤...但它不起作用 Feign Hystrix fallback not working

【问题讨论】:

  • 您找到解决方案了吗?
  • 不。没试过
  • feign.circuitbreaker.enabled=true 有效。

标签: spring-cloud hystrix spring-cloud-feign


【解决方案1】:

好像是属性

feign.hystrix.enabled=true

改为

feign.circuitbreaker.enabled=true

【讨论】:

    猜你喜欢
    • 2018-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-20
    • 1970-01-01
    相关资源
    最近更新 更多