博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Spring cloud Netflix中的超时配置
阅读量:6911 次
发布时间:2019-06-27

本文共 977 字,大约阅读时间需要 3 分钟。

hot3.png

一般SpringCloud中超时配置,含Hystrix/Ribbon两部分:

ribbon:  ReadTimeout: 120000  ConnectTimeout: 120000  hystrix:  command:    default:      execution:        isolation:          strategy: THREAD          thread:            timeoutInMilliseconds: 120000

hystrix thread timeout需要比ribbon timeout设置时间长。

ribbon有retry机制,如果timeout设置时间短,则无法retry。

在zuul中,如果使用的是服务发现,ribbon timeout同上。

如果使用的指定URL形式,ribbon timeout需要如下配置:

zuul:  host:    connect-timeout-millis: 120000    socket-timeout-millis: 120000

8.13 Zuul Timeouts If you want to configure the socket timeouts and read timeouts for requests proxied through Zuul, you have two options, based on your configuration: If Zuul uses service discovery, you need to configure these timeouts with the ribbon.ReadTimeout and ribbon.SocketTimeout Ribbon properties. If you have configured Zuul routes by specifying URLs, you need to use zuul.host.connect-timeout-millis and zuul.host.socket-timeout-millis.

转载于:https://my.oschina.net/elleneye/blog/2967619

你可能感兴趣的文章
JAVA--------抽象类
查看>>
我的友情链接
查看>>
动画状态切换
查看>>
linux 下的GPT分区
查看>>
线程同步
查看>>
Nginx 配置SSL证书
查看>>
每日总结复习
查看>>
iPhone 开发过程中的一些小技术的总结
查看>>
android 资料
查看>>
ThreadLocal 那点事儿
查看>>
Spark源码分析调试环境搭建
查看>>
手把手教你搭建LyncServer2013之命令行持久聊天室和聊天室BUG(十五)
查看>>
全栈工程师就是一棵歪脖子树
查看>>
计算机基础
查看>>
我的友情链接
查看>>
MySQL学习笔记(14)之事务
查看>>
基于Http原理实现Android的图片上传和表单提交
查看>>
解读大数据世界中MapReduce的前世今生
查看>>
【转】TCP为什么是个可靠的协议
查看>>
Word组件Spire.Doc6.0.52 发布| 修复转PDF文本重叠的问题
查看>>