首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >OpenFeign超时控制

OpenFeign超时控制

作者头像
DencyCheng
发布于 2020-12-01 10:47:59
发布于 2020-12-01 10:47:59
1.8K0
举报
文章被收录于专栏:SpringBootSpringBoot

OpenFeign默认等待一秒钟,超过后报错

代码语言:javascript
复制
Request processing failed; nested exception is feign.RetryableException: connect timed out executing GET http://CLOUD-PAYMENT-SERVICE/payment/getTimeout/1] with root cause

由于OpenFeign底层是由Ribbon实现的,所以我们只要修改Ribbon的配置即可

代码语言:javascript
复制
ribbon:
  ReadTimeout: 5000
  ConnectTimeout: 5000

再次实验就可以正常访问了

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/11/26 ,如有侵权请联系 cloudcommunity@tencent.com 删除
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档