首次访问会有一个timeout 500的错误https://github.com/spring-cloud/spring-cloud-netflix/issues/768java.util.concurrent.TimeoutException: nullat com.netflix.hystrix.AbstractCommand$9.call(AbstractCommand.java:596) ~[hystrix-core-1.4.21.jar:1.4.21]at com.netflix.hystrix.AbstractCommand$9.call(AbstractCommand.java:577) ~[hystrix-core-1.4.21.jar:1.4.21]at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:99) ~[rxjava-1.0.14.jar:1.0.14]at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70) ~[rxjava-1.0.14.jar:1.0.14]at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:70) ~[rxjava-1.0.14.jar:1.0.14]at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$1.run(AbstractCommand.java:951) ~[hystrix-core-1.4.21.jar:1.4.21]at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable$1.call(HystrixContextRunnable.java:41) ~[hystrix-core-1.4.21.jar:1.4.21]at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable$1.call(HystrixContextRunnable.java:37) ~[hystrix-core-1.4.21.jar:1.4.21]at com.netflix.hystrix.strategy.concurrency.HystrixContextRunnable.run(HystrixContextRunnable.java:57) ~[hystrix-core-1.4.21.jar:1.4.21]at com.netflix.hystrix.AbstractCommand$HystrixObservableTimeoutOperator$2.tick(AbstractCommand.java:971) ~[hystrix-core-1.4.21.jar:1.4.21]at com.netflix.hystrix.util.HystrixTimer$1.run(HystrixTimer.java:98) ~[hystrix-core-1.4.21.jar:1.4.21]at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[na:1.8.0_66]at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) ~[na:1.8.0_66]at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_66]at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) ~[na:1.8.0_66]at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_66]at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_66]at java.lang.Thread.run(Thread.java:745) [na:1.8.0_66]跟我们的异常是一样的@spencergibb After a bunch more experimentation with a simplified client, I believe everything really is working OK, and the initial request just takes longer than 1 second, which is the default hystrix timeout. I'm guessing some framework related code lazily does certain tasks so the initial request really does just take longer so the timeout is valid. I apologize for the noise. Thanks for the help!7. Declarative REST Client: FeignSpring Cloud integrates Ribbon and Eureka to provide a load balanced http client when using Feign.其实它还整合了一个东西是hystrix,它是Feign的一个小东西,由于我们第一次请求的时候超过一秒,所以就报了一个超时的异常Hystrix command fails with "timed-out" and no fallback avaliablehttps://stackoverflow.com/questions/27375557/hystrix-command-fails-with-timed-out-and-no-fallback-available默认的时间是一秒,然后我们可以看一下这个时间execution.isolation.thread.timeoutInMilliseconds:timeoutInMilliseconds,我们配一下这个东西就OK了# 解决第一次请求报超时异常的方案:
# hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 5000
# 或者:
# hystrix.command.default.execution.timeout.enabled: false
# 或者:
feign.hystrix.enabled: false ## 索性禁用feign的hystrix# 超时的issue:https://github.com/spring-cloud/spring-cloud-netflix/issues/768
# 超时的解决方案: http://stackoverflow.com/questions/27375557/hystrix-command-fails-with-timed-out-and-no-fallback-available
# hystrix配置: https://github.com/Netflix/Hystrix/wiki/Configuration#execution.isolation.thread.timeoutInMillisecondshystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 5000发现就OK了,这是第一种做法他不是有超时时间吗,那我把超时时间给禁用掉不就行了,hystrix.command.default.execution.timeout.enabled: false就是不超时,也可以还有一个是最变态,同时也是最彻底的是什么呢,feign.hystrix.enabled: false ## 索性禁用feign的hystrixhttps://github.com/Netflix/Hystrix/wiki/Configuration#execution.isolation.thread.timeoutInMilliseconds可以看他的各种配置execution.isolation.thread.timeoutInMillisecondsexecution.timeout.enabled

Fegion-4解决Fegion第一次请求timeout的问题相关推荐

  1. 解决Spring Cloud中Feign/Ribbon第一次请求失败的方法

    前言 在Spring Cloud中,Feign和Ribbon在整合了Hystrix后,可能会出现首次调用失败的问题,要如何解决该问题呢? 造成该问题的原因 Hystrix默认的超时时间是1秒,如果超过 ...

  2. spring cloud gateway中解决第一次请求失败的问题

    spring cloud gateway中解决第一次请求失败的问题 参考文章: (1)spring cloud gateway中解决第一次请求失败的问题 (2)https://www.cnblogs. ...

  3. 技术实践丨如何解决异步接口请求快慢不均导致的数据错误问题?

    本文分享自华为云社区<如何解决异步接口请求快慢不均导致的数据错误问题?>,原文作者:Kagol . 引言 搜索功能,我想很多业务都会涉及,这个功能的特点是: 用户可以在输入框中输入一个关键 ...

  4. php 返回字符串给aja,解决ajax异步请求返回的是字符串问题

    1.返回结果差异 js获取后打印res.code无结果.因为返回数据格式不正确. php文件添加header头: header('Content-Type:application/json;'); 或 ...

  5. 水晶报表,解决——提示“您请求的报表需要更多信息.”

    水晶报表,解决--提示"您请求的报表需要更多信息." string sql = "Select * from Orders";string DBConfig_s ...

  6. Ajax 调用webservice 解决跨域请求和发布到服务器后本地调用成功外网失败的问题...

    webservice 代码 1 /// <summary> 2 /// MESService 的摘要说明 3 /// </summary> 4 [WebService(Name ...

  7. 五、手动取消ajax请求 解决重复发送请求问题

    server.js: // 1. 引入express const express = require('express')// 2. 创建应用对象 const app = express()// 3. ...

  8. 解决Springboot get请求是参数过长的情况

    解决Springboot get请求是参数过长的情况 问题原因 Springboot get请求是参数过长抛出异常:Request header is too large 的问题 错误描述 java. ...

  9. C#解决Webservice第一次访问特别慢的问题

    C#解决Webservice第一次访问特别慢的问题 最近做一个项目遇到首次加载webservice(.NET4)的时候特别慢,于是 百度一番,得到结果是 在客户端(WinForm) *.EXE程序(. ...

最新文章

  1. HTML5学习笔记二 HTML基础
  2. python在日常工作处理中的应用-记 Python 在实际工作中的第一次应用
  3. UVa11809 - Floating-Point Numbers
  4. python编码问题总结
  5. 李菲菲课程笔记:Deep Learning for Computer Vision – Introduction to Convolution Neural Networks
  6. 服务器磁盘操作系统双机软件集成,实战:ROSE HA双机热备系统安装指南
  7. Python客户端syn连接
  8. 26个Jquery使用小技巧(jQuery tips, tricks amp; solutions)
  9. centos7 卸载软件
  10. 微博黄v怎么认证:微博兴趣认证技巧
  11. 《python深度学习》笔记(八):回归问题
  12. java大作穿越arpg_动作与角色扮演完美结合 精品ARPG游戏盘点
  13. 刘涛入职阿里P10,年薪150W+:不做演员,也很优秀
  14. SAS9.4+sid更新
  15. 机器人工程专业学习金字塔
  16. 搭建PXE自动安装centos
  17. 如何加密 WildFly 数据源密码
  18. 物联网新零售项目 立可得2.0之“前世今生”
  19. 结交各大云平台 IoT 专家的机会来啦!
  20. 出自名门:微软杀毒软件MSE 2.1 正式版下载

热门文章

  1. 五、线程管理————GCD
  2. Oracle中的正则表达式(REPLACE 和REGEXP_REPLACE)---转载自http://database.51cto.com/art/201009/228270.htm...
  3. 关于空值null的排序问题 mysql 和oracle
  4. php面试专题---2、常量及数据类型考点
  5. 浅析VS2010反汇编 VS 反汇编方法及常用汇编指令介绍 VS2015使用技巧 调试-反汇编 查看C语言代码对应的汇编代码...
  6. 创建故障转移群集,LiveMigration系列之六
  7. 处理Img标签中src无效时出现的border
  8. Windows下mysql忘记密码的解决方法
  9. MySql中添加用户/删除用户
  10. JS 对select动态添加options操作[IEFireFox兼容]