学习Spring Cloud第十三课(解决第一次访问报超时的问题)
来源:互联网 发布:如何屏蔽淘宝短信 编辑:程序博客网 时间:2024/06/09 21:56
在前几节课我们第一次访问http://localhost:8010/movie/1这个地址的时候经常会看到超时错误,这个错误其实是因为feign集成了hystrix,而hystrix默认的超时时间是1秒,如果我们的请求超过了1秒,那么就会报超时错误。
针对这种情况,有三种方法可以解决:
在microservice-simple-consumer-movie-feign-customizing的application.yml文件中配置如下三种方案中的一种(根据实际情况自行选择)
第一种:延长超时时间
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 5000
第二种:禁用超时
hystrix.command.default.execution.timeout.enabled: false
第三种:索性禁用feign的hystrix
feign.hystrix.enabled: false
然后我们再依次启动eureaka、两个不同端口的user工程、feign-customizing,然后访问http://localhost:8010/movie/1就会发现不会超时了。
阅读全文
0 0
- 学习Spring Cloud第十三课(解决第一次访问报超时的问题)
- Spring Cloud中,如何解决Feign/Ribbon第一次请求失败的问题?
- Spring Cloud中,如何解决Feign/Ribbon第一次请求失败的问题?
- Spring Cloud中,如何解决Feign/Ribbon第一次请求失败的问题?
- 解决Spring Cloud第一次调用失败
- spring-cloud-zuul超时
- 学习Spring cloud第二课(初识Spring cloud)
- 学习Spring cloud第二课(初识Spring cloud)
- WCF RIA 解决超时报错问题
- 学习Spring Cloud第七课(Ribbon的基本使用)
- 学习Spring Cloud第七课(Ribbon的基本使用)
- 解决Webservice第一次访问特别慢的问题
- 解决Asp.net Web网站第一次访问慢的问题
- spring cloud遇到的问题
- 解决Spring Cloud中Feign/Ribbon第一次请求失败的方法___http://www.jb51.net/article/106944.htm
- 解决pip超时的问题
- 配置全局的ajax,解决访问超时
- spring cloud之安全访问(八)
- ubantu使用mentohust上锐捷
- 日期类
- AppTheme属性设置集合
- POJ 3167
- Hibernate的Session详解
- 学习Spring Cloud第十三课(解决第一次访问报超时的问题)
- 从别的角度看:阻塞与非阻塞《转载公众号:xy_ee》
- linux 命令访问网址curl
- jvm3
- LeetCode 34. Search for a Range
- typed.js 打字机效果
- 安的首篇博客
- 生活小记62
- mybatis系列一:入门篇