Spring Cloud 使用 OpenFeign 报错

connect timed out executing GET http://CLOUD-PAYMENT-SERVICE/payment/feign/timeout

feign.RetryableException: connect timed out executing GET http://CLOUD-PAYMENT-SERVICE/payment/feign/timeout at feign.FeignException.errorExecuting(FeignException.java:213) at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:115) at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:80) at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:103) at com.sun.proxy.$Proxy158.paymentFeignTimout(Unknown Source) at com.cup.springcloud.controller.OrderFeignController.paymentFeignTimout(OrderFeignController.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

......

错误原因

OpenFeign 调用超时,OpenFeign 底层有 Ribbon, 而 它的默认超时时间是 1 s ,如果你确定你的调用代码是正确的,那么说明是业务处理时间超过了 1 s ,这样的话只需要将超时时间设置的长一点就可以了

是在服务消费方中设置:

# 设置 feign 客户端超时时间(OpenFeign 默认支持 ribbon)
ribbon:# 值的是建立连接所用的时间,使用与网络状态正常的情况,两端连接所用的时间ReadTimeout: 5000# 指的是建立连接后从服务器读取到可用资源所用的时间ConnectionTimeout: 5000

设置足够长的时间后,如果运行后等待了你设置的时间后又报了同样的错误,那肯定是 OpenFeign 的调用流程写的有问题,反复检查。

feign.RetryableException: connect timed out executing xxxxxx相关推荐

  1. feign.RetryableException: Read timed out executing POST http://......

    问题描述 SpringCloud微服务之间远程调用报错超时. feign.RetryableException: Read timed out executing POST http://...... ...

  2. 微服务调用异常:error feign.RetryableException: Read timed out executing POST http://xxx.......

    最近在将nacos server版本从1.3版本升级到1.4版本,接口服务调用基础的搜索服务时出现以上异常.因为是时而正常,时而超时,推测是注册客户端的版本过低,于是升级Nacos client版本, ...

  3. feign.RetryableException: Read timed out executing 异常解决办法

    首先看一下报错整体: feign.RetryableException: Read timed out executing GET (你访问的地址)at feign.FeignException.er ...

  4. feign.RetryableException: Read timed out executing GET

    一.判断是否有开启代理 之前有开启vpn加速代理,导致超时,此种情况下关闭代理即可. 二.真实接口响应较慢 调整feign超时时间配置 yaml配置: feign:client:config:defa ...

  5. 【springCloud】feign.RetryableException: Read timed out executing GET.。的有效解决办法

    1.错误如下图 2.解决办法 错误提示是请求超时,那我们就把请求的时间改大不久行了,这也是网上的大多数朋友给的解决方案,在网关配置ribbon: ribbon:ConnectTimeout: 6000 ...

  6. feign.RetryableException: Read timed out executing GET http://*****

    解决方法: 在项目的application.properties文件中添加如下配置: #全局配置 # 请求连接的超时时间 默认的时间为 1 秒 ribbon.ConnectTimeout=5000 # ...

  7. Request processing failed; nested exception is feign.RetryableException: Read timed out

    前言 spring boot 2.0.0.RELEASE spring cloud Finchley.RELEASE 错误:Request processing failed; nested exce ...

  8. nested exception is feign.RetryableException: Incomplete output stream executing POST http://

    一.背景 SpringCloud微服务框架中使用OpenFeign做服务间调用时(入参为@ResponseBody标注的JavaBean,请求类型为POST),被调用方正常执行,调用方报错,报错信息如 ...

  9. 解决SpringCloud之Feign超时问题(Read timed out executing POST http://***)

    Question: 在调用外部接口时可能会由于延迟,造成造成Feign "Read timed out executing POST" feign.RetryableExcepti ...

最新文章

  1. AI校招程序员最高薪酬曝光!腾讯80万年薪领跑,还送北京户口
  2. python分组求和_Python学习笔记之pandas索引列、过滤、分组、求和功能示例
  3. lintcode_75.寻找峰值
  4. 专访刘伟:软件开发人员的内功修炼之道
  5. const与指针变量
  6. mapreduce分组统计_如何优雅的理解MapReduce
  7. 万用表判断场效应管的好坏
  8. [Lintcode]66. Binary Tree Preorder Traversal/[Leetcode]144. Binary Tree Preorder Traversal
  9. jvm 堆外内存_jvm┃java内存区域,跳槽大厂必会知识点
  10. Android IPC数据在内核空间中的发送过程分析
  11. 2018年香港访港旅客超6500万人次 创16年新高
  12. reactbootstrap php,什么是React-Bootstrap
  13. linux下fish配置终端,如何在Linux中安装、配置和使用Fish Shell?
  14. 网络编程练手小项目---英英词典
  15. 搜狐狐友与腾讯微信两款社交软件的比较
  16. Android应用快捷方式
  17. 怎么用软件测试睡眠质量差怎么办,手机软件可测睡眠质量?
  18. Kalman滤波在温度测量中的应用(含MATLAB仿真)
  19. 开关电源-半桥LLC控制
  20. 【数据结构 树:二叉树分类、红黑树讲解】

热门文章

  1. 阿里的简历多久可以投递一次?次数多了有没有影响?可以同时进行吗?
  2. 论文解读:医学影像中的注意力机制
  3. qq群文件问题完美解决
  4. 科技正渗透进你生活的全部
  5. Linux文件锁(Filelock)是什么,怎么用?
  6. linux基因组文件,科学网-NGS基础 - 参考基因组和基因注释文件-陈同的博文
  7. 定积分的基本性质6 积分第一中值定理
  8. 半路出家程序员的痛旁人不会懂
  9. 如何在 Python3 中对列表 通过比较排序(不懂就问)?
  10. 《中国航海》投稿经验