feign调用失败 feign.RetryableException: xxx-service executing GET http://xxx/test
一。 问题引入
升级springcloud的版本后 突然发现 以前正常的feign调用也报错了
升级后的各组件版本如下
spring cloud 2021.0.5
spring cloud alibaba 2021.0.5.0
spring boot 2.6.13
错误日志如下
feign.RetryableException: xxx-service executing GET http://xxx-service/goods/teestcurrent=1&size=10at feign.FeignException.errorExecuting(FeignException.java:268)at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:131)at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:91)at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)at org.springframework.cloud.openfeign.FeignCachingInvocationHandlerFactory$1.proceed(FeignCachingInvocationHandlerFactory.java:66)at org.springframework.cache.interceptor.CacheInterceptor.lambda$invoke$0(CacheInterceptor.java:54)at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:351)at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:64)at org.springframework.cloud.openfeign.FeignCachingInvocationHandlerFactory.lambda$create$1(FeignCachingInvocationHandlerFactory.java:53)at jdk.proxy2/jdk.proxy2.$Proxy257.listGoodsLabel(Unknown Source)at com.style.goods.sdk.xxxSDK.lambda$listGoodsLabel$0(GoodsLabelSDK.java:31)at com.style.common.core.utils.sdk.SdkUtil.handle(SdkUtil.java:21)at com.style.goods.sdk.xxxSDK.test(GoodsLabelSDK.java:31)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.base/java.lang.reflect.Method.invoke(Method.java:568)at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Caused by: java.net.UnknownHostException: xxx-serviceat java.base/java.net.InetAddress$CachedAddresses.get(InetAddress.java:801)at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1533)at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1385)at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1306)at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112)at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:376)at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:393)at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)at brave.httpclient.TracingMainExec.execute(TracingMainExec.java:65)at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)at brave.httpclient.TracingProtocolExec.execute(TracingProtocolExec.java:66)at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)at feign.httpclient.ApacheHttpClient.execute(ApacheHttpClient.java:83)at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:121)... 81 more
二。问题分析
刚看到 Caused by: java.net.UnknownHostException: xxx-service
还以为网络问题,居然一想 这是feign调用
然后开始逐步排查
- 检查调用的服务 是否在nacos上
- 检查 调用者 与调用者是否在同一个 namespace上
- 检查被调用的服务启动状况
检查完成 也没发现问题
问题的本质还是 服务间调用不同 然后开始从官网找下文档 文档的
官方文档的描述如下 https://docs.spring.io/spring-cloud-openfeign/docs/3.1.8/reference/html/#netflix-feign-starter
spring-cloud-starter-openfeign supports spring-cloud-starter-loadbalancer. However, as is an optional dependency, you need to make sure it been added to your project if you want to use it.
openfeign 默认的负载均衡组件是ribbon 由于我们升级了springcloud版本 新版本的springcloud 移除了ribbon 所以为了openfeign 负载均衡生效 我们需要引入loadbalancer
三。问题解决
- 引入loadbalancer
<dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
四。 另外说明
feign调用失败的异常 还有其他的原因 如上只是一种可能 包括但不仅限于如下
- 被调用方未注册到nacos 或者注册nacos失败
- 被调用方和调用方 不在同一个 namespace
- 被调用方和调用方 不在同一个 nacos
- 被调用方 应用未启动
- 被调用方 调用失败报错
- feign client设置问题 name不对
- feign client设置问题 url 有误
- 网络问题超时
- 框架版本兼容问题
- 等等
相关文章:
feign调用失败 feign.RetryableException: xxx-service executing GET http://xxx/test
一。 问题引入 升级springcloud的版本后 突然发现 以前正常的feign调用也报错了 升级后的各组件版本如下 spring cloud 2021.0.5 spring cloud alibaba 2021.0.5.0 spring boot 2.6.13 错误日志如下 feign.RetryableException: xxx-service executing GET http://xxx-servic…...
mysql 用户管理
目录 用户 创建用户 删除用户 修改密码 权限管理 赋权 查看权限 插销权限 总结 用户 mysql 的用户都存在于系统数据库 mysql 的user 表中 mysql> show tables; --------------------------- | Tables_in_mysql | --------------------------- | column…...
pyinstaller打包exe运行闪退
这里写自定义目录标题 前言问题描述解决过程 前言 闪退原因可能有很多,这里记录下我遇到的问题,简单来说是dll调用错误导致的闪退,因为我的python用的是32位的,但是pyinstaller却是64位的,属于用conda的时候没注意。 …...
ARM 汇编基础知识
1.为什么学习汇编? 我们在进行嵌入式 Linux 开发的时候是绝对要掌握基本的 ARM 汇编,因为 Cortex-A 芯片一 上电 SP 指针还没初始化, C 环境还没准备好,所以肯定不能运行 C 代码,必须先用汇编语言设置好 C 环境…...
CRM 自动化如何改善销售和客户服务?
许多 B2B 和 B2C 公司都使用 CRM 系统来组织业务流程,使复杂的任务更容易完成。企业可以使用 CRM 自动化来自动化工作流程,让团队有更多的时间来执行高价值的任务,而不是陷于一堆琐碎事情中。 什么是CRM自动化? CRM 自动化是指 C…...
Bean 的六种作用域
目录 一、作用域是什么? 1、singleton(单例作用域) 2、prototype(原型作用域) 3、request(请求作用域) 4、session(回话作用域) 5、application(全局作用域&a…...
go语言--锁
锁的基础,go的锁是构建在原子操作和信号锁之上的 原子锁 原子包实现协程的对同一个数据的操作,可以实现原子操作,只能用于简单变量的简单操作,可以把多个操作变成一个操作 sema锁 也叫信号量锁/信号锁 核心是一个uint32值&#…...
再见,CSDN
从我2018年1月31日加入CSDN,到现在已经5年多的时间了。在这5年里,陆陆续续在CSDN上发布了很多论文阅读笔记、教程、技术文章等等,记录了我从大四到研究生再到工作这段时间的学习和成长轨迹。 我一直有备份个人资料的习惯,尤其是耗…...
MySQL总复习
目录 登录 显示数据库 创建数据库 删除数据库 使用数据库 创建表 添加数据表数据 查询表 添加数据表多条数据 查询表中某数据 增insert 删delete 改update 查select where like 编辑 范围查找 order by 聚合函数 count max min sum avg g…...
桌面平台层安全随手记录
声明 本文是学习桌面云安全技术要求. 而整理的学习笔记,分享出来希望更多人受益,如果存在侵权请及时联系我们 桌面平台层安全 桌面接入安全 用户标识 一般要求 本项要求包括: a) 系统应为用户提供唯一的身份标识,同时将用户的身份标识与该用户的所…...
【Docker】 08-Dockerfile
什么是Dockerfile Dockerfile可以认为是Docker镜像的描述文件,是由一系列命令和参数构成的教程,主要作用是用来构建docker镜像的构建文件。 Dockerfile解析过程 Dockerfile的保留命令 保留字作用FROM当前镜像是基于哪个镜像的 第一个指令必须是FROMMA…...
【二等奖方案】大规模金融图数据中异常风险行为模式挖掘赛题「Aries」解题思路
第十届CCF大数据与计算智能大赛(2022 CCF BDCI)已圆满结束,大赛官方竞赛平台DataFountain(简称DF平台)正在陆续释出各赛题获奖队伍的方案思路,欢迎广大数据科学家交流讨论。 本方案为【大规模金融图数据中…...
Github 下载指定文件夹(git sparse-checkout)
比如要下载这里的 data_utils 步骤 1、新建空文件夹,并进入新建的空文件夹。 2、git init 初始化 3、git remote add origin 添加远程仓库 4、git config core.sparsecheckout true 允许稀疏检出 5、git sparse-checkout set 设置需要拉取的文件夹(可…...
蚂蚁集团SQLess 开源,与内部版有何区别?
当我们使用关系型数据库时,SQL 是联系起用户和数据库的一座桥梁。 SQL 是一种高度非过程化的语言,当我们在编写SQL 时,表达的是想要什么数据,而不是怎么获取数据。因此,我们往往更关心SQL 有没有满足业务逻辑ÿ…...
An Efficient Memory-Augmented Transformer for Knowledge-Intensive NLP Tasks
本文是LLM系列文章,针对《An Efficient Memory-Augmented Transformer for Knowledge 一种用于知识密集型NLP任务的高效内存增强转换器 摘要1 引言2 相关工作3 高效内存增强Transformer4 EMAT的训练流程5 实验6 分析7 结论局限性 摘要 获取外部知识对于许多自然语言…...
Java项目中jar war pom包的区别
1、pom:用在父级工程或聚合工程中,用来做jar包的版本控制,必须指明这个聚合工程的打包方式为pom。 <project ...> <modelVersion>4.0.0</modelVersion> <groupId>com.wong.tech</groupId> <artifactI…...
整理mongodb文档:分页
个人博客 整理mongodb文档:分页 个人博客,求关注,如果文章不够清晰,麻烦指出。 文章概叙 本文主要讲下在聚合以及crud的find方法中如何使用limit还有skip进行排序。 分页的情况很经常出现,这也是这篇博客诞生的理由。 数据准备…...
社区团购新玩法,生鲜蔬菜配货发货小程序商城
在当前的电商市场中,生鲜市场具有巨大的潜力和发展空间。为了满足消费者的需求,许多生鲜店正在寻找创新的方法来提高销售和客户满意度。其中,制作一个个性且功能强大的生鲜小程序商城是一个非常有效的策略。以下是在乔拓云平台上制作生鲜小程…...
shell bash中设置命令set
1 Preface/Foreword set命令用于shell脚本在执行命令时候,遇到异常的处理机制。 2 Usage 2.1 set -e 当执行命令过程中遇到异常,那么就退出脚本,不会往下执行其它命令。 #!/bin/bash #set -eroot GIT_TAG${CI_BUILD_TAG-NOTAG} GIT_REV…...
机器学习---预剪枝、后剪枝(REP、CCP、PEP、)
1. 为什么要进行剪枝 横轴表示在决策树创建过程中树的结点总数,纵轴表示决策树的预测精度。 实线显示的是决策树 在训练集上的精度,虚线显示的则是在⼀个独⽴的测试集上测量出来的精度。 随着树的增⻓,在 训练样集上的精度是单调上升的&…...
Youtu-VL-4B-Instruct快速上手:从拉取镜像到自定义端口,完整部署指南
Youtu-VL-4B-Instruct快速上手:从拉取镜像到自定义端口,完整部署指南 1. 环境准备与镜像拉取 在开始部署Youtu-VL-4B-Instruct之前,我们需要确保运行环境满足基本要求。这个轻量级但功能强大的视觉-语言模型需要特定的硬件和软件支持才能发…...
学习笔记-http协议
1.http介绍http(超文本运输协议)是一种应用层协议,他定义了web客户机是如何向web服务器请求web页面,以及服务器如何将web页面传送给客户机的。他是基于 TCP(HTTP/3 基于 UDP)的结构化请求 - 响应协议&#…...
C#怎么获取U盘的插拔事件_C#如何重写WndProc捕获消息【进阶】
不能,WndProc 本身无法直接捕获 U 盘插拔,必须先调用 RegisterDeviceNotification 注册设备通知,才能使系统将 WM_DEVICECHANGE 消息路由至 WndProc 并正确解析 m.WParam 和 m.LParam。WndProc 能捕获 U 盘插拔吗?不能,…...
Windows下OpenClaw安装指南:快速对接Phi-3-vision-128k-instruct图文模型
Windows下OpenClaw安装指南:快速对接Phi-3-vision-128k-instruct图文模型 1. 环境准备与安装 在Windows系统上部署OpenClaw需要先确保基础环境就绪。我使用的是Windows 11专业版22H2版本,整个过程大约需要15分钟。建议提前准备管理员权限的PowerShell窗…...
交换机接口全解析:从RJ-45到光纤,一文掌握所有连接技巧
1. 交换机接口基础:认识常见的物理接口类型 第一次拆开交换机包装时,面对密密麻麻的接口面板,新手常会感到无从下手。其实这些接口按照传输介质可分为两大阵营:电口和光口。电口就是我们熟悉的RJ-45接口,而光口则包含…...
FLUX.2-klein-base-9b-nvfp4快速入门:小白也能玩转AI图片编辑
FLUX.2-klein-base-9b-nvfp4快速入门:小白也能玩转AI图片编辑 1. 为什么选择这个AI图片编辑工具 你是否遇到过这些情况: 看到网上的漂亮衣服,想知道穿在自己身上是什么效果想给照片中的衣服换个颜色或添加文字,但不会用专业修图…...
手机生成剧本杀软件2025推荐,创新剧情设计工具助力创作
手机生成剧本杀软件2025推荐,创新剧情设计工具助力创作随着剧本杀市场的蓬勃发展,越来越多的创作者和爱好者希望借助科技的力量来提升创作效率和质量。在2025年,一款名为量子探险AI剧本杀工坊的手机生成剧本杀软件脱颖而出,成为众…...
Picocli错误处理终极指南:7个技巧构建健壮命令行应用
Picocli错误处理终极指南:7个技巧构建健壮命令行应用 【免费下载链接】picocli Picocli is a modern framework for building powerful, user-friendly, GraalVM-enabled command line apps with ease. It supports colors, autocompletion, subcommands, and more.…...
造相-Z-Image-Turbo 在运维监控中的创意应用:生成系统状态拟人化报告图
造相-Z-Image-Turbo 在运维监控中的创意应用:生成系统状态拟人化报告图 每次打开监控大屏,面对满屏跳动的数字和密密麻麻的曲线图,你是不是也感到一阵视觉疲劳?CPU 80%、内存占用率65%、网络丢包0.1%……这些冰冷的指标虽然精确&…...
从XML解析到特征提取:手把手搞定Wikipedia多模态数据集的预处理全流程
从XML解析到特征提取:Wikipedia多模态数据集预处理实战指南 引言 在机器学习项目中,数据预处理往往占据整个流程70%以上的工作量。特别是面对Wikipedia这类包含文本和图像的多模态数据集时,工程师需要同时处理XML文档解析、图像特征提取、跨模…...
