Feign整合Sentinel 開啟 feign.sentinel.enabled=true 啟動報錯

zhaozhangxiao發表於2022-05-10

Feign整合Sentinel 開啟 feign.sentinel.enabled=true 啟動報錯 Requested bean is currently in creation: Is there an unresolvable circular reference?

Spring Boot 版本為:2.3.9.RELEASE
Spring Cloud版本為:Hoxton.SR10
Spring Cloud Alibaba版本為:2.2.5.RELEASE

報錯資訊:

Feign整合Sentinel 開啟 feign.sentinel.enabled=true 啟動報錯

修改Spring Cloud 版本為Hoxton.SR8 啟動成功

Feign整合Sentinel 開啟 feign.sentinel.enabled=true 啟動報錯

熔斷回撥寫法:

@FeignClient(value = "user-service",fallbackFactory = UserClientFallbackFactory.class)
public interface UserClient {
    @GetMapping("/user/getUserInfoById/{id}")
    User getUserInfoById(@PathVariable Integer id);

Feign整合Sentinel 開啟 feign.sentinel.enabled=true 啟動報錯

啟動項配置

Feign整合Sentinel 開啟 feign.sentinel.enabled=true 啟動報錯

熔斷生效:

Feign整合Sentinel 開啟 feign.sentinel.enabled=true 啟動報錯

Feign整合Sentinel 開啟 feign.sentinel.enabled=true 啟動報錯

本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章