Feign - Hystrix - feign.RetryableException:连接被拒绝:没有更多信息执行 GET

Posted

技术标签:

【中文标题】Feign - Hystrix - feign.RetryableException:连接被拒绝:没有更多信息执行 GET【英文标题】:Feign - Hystrix - feign.RetryableException: Connection refused: no further information executing 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 有效。 【参考方案1】:

好像是属性

feign.hystrix.enabled=true

改为

feign.circuitbreaker.enabled=true

【讨论】:

以上是关于Feign - Hystrix - feign.RetryableException:连接被拒绝:没有更多信息执行 GET的主要内容,如果未能解决你的问题,请参考以下文章

feign + hystrix 降级

12Feign整合断路器Hystrix

0503-Hystrix保护应用-feign的hystrix支持

Feign中使用hystrix

跟我学Spring Cloud(Finchley版)-14-Feign使用Hystrix

Feign - Hystrix - feign.RetryableException:连接被拒绝:没有更多信息执行 GET