把hystrix设成5s后,从网关访问product/list依然显示超时
来源:10-8 Zuul:超时配置

Peter陳
2019-01-17
我在product服务的接口list中加了Thread.sleep(3000);
并且在api-gateway中设了5s超时
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 5000 #默认超时时间
但通过网关调用list接口时依然报Gateway Timeout
网关接口
http://localhost:8000/product/product/list
返回值
{
“timestamp”: “2019-01-17T03:07:42.166+0000”,
“status”: 504,
“error”: “Gateway Timeout”,
“message”: “com.netflix.zuul.exception.ZuulException: Hystrix Readed time out”
}
于是我在yml文件中添加了
ribbon:
ReadTimeout: 5000
就好了,能成功访问了。请老师帮忙解释一下。谢谢
写回答
1回答
-
廖师兄
2019-01-18
你的springcloud什么版本,不同版本配置方式有改动,课程最后升级部分有说
00
SpringCloud Finchley(M2+RELEASE+SR2)微服务实战
SpringCloud组件实现微服务,【已升级Finchley.Release】
5673 学习 · 2489 问题
相似问题