设置了5s超时时间,从网关访问product/list时依然超时

来源:10-8 Zuul:超时配置

Peter陳

2019-01-17

1.在gateway设置yml
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 5000 #默认超时时间
2.在product的list接口中延时3秒
Thread.sleep(3000);
3.通过网关调用product/list
http://localhost:8000/product/product/list
{
“timestamp”: “2019-01-17T03:32:32.885+0000”,
“status”: 504,
“error”: “Gateway Timeout”,
“message”: “com.netflix.zuul.exception.ZuulException: Hystrix Readed time out”
}
4.但如果在网关中设置如下参数,就不会超时了。
ribbon:
ReadTimeout: 5000
请老师帮忙解释一下。谢谢

写回答

4回答

廖师兄助理

2020-04-16

查看一下springboot版本是否和师兄一致

0
0

牛气大志

2020-04-16

##知道了,2.1版本的
# com.netflix.zuul.exception.ZuulException: Hystrix Readed time out;  "error": "Gateway Timeout",
zuul:
 prefix:
 host: # connect-timeout-millis 6万一分钟, 4分钟=24万 #HTTP连接超时要比Hystrix的大
   connect-timeout-millis: 240000
   socket-timeout-millis: 60000   #socket超时

# com.netflix.zuul.exception.ZuulException: Hystrix Readed time out;  "error": "Gateway Timeout",
ribbon:
   ConnectTimeout: 60000
   ReadTimeout: 60000
   MaxTotalHttpConnections: 10000
   MaxConnectionsPerHost: 10000


0
0

林子懿0509

2019-08-16

你可以看一下,请求时间是多少,可能超过5秒了,所以才提示你这个

0
0

廖师兄

2019-01-18

同学你好,为了方便老师回答以及同学查阅,请不要发布相同问题。

0
0

SpringCloud Finchley(M2+RELEASE+SR2)微服务实战

SpringCloud组件实现微服务,【已升级Finchley.Release】

5673 学习 · 2489 问题

查看课程