通过API网关路由来访问用户服务,zuul默认路由规则 :http://zuul的Host地址:zuul端口/要调用的服务名/服务方法地址

  浏览器中打开http://127.0.0.1:8000/wallet/system/hello/1
  报错:
  This application has no explicit mapping for /error, so you are seeing this as a fallback.
  Tue Aug 07 17:49:01 CST 2018
  There was an unexpected error (type=Gateway Timeout, status=504).
  com.netflix.zuul.exception.ZuulException: Hystrix Readed time out

com.netflix.zuul.exception.ZuulException: Hystrix Readed time out

这个错误是应为zuul的默认超时时间比较小,我们配置下zuul的超时时间,因zuul启用了ribbon的负载均衡,还需要设置ribbon的超时时间,注意ribbon的超时时间要小于zuul超时时间 。

 

zuul:
  host:
    connect-timeout-millis: 15000 #HTTP连接超时要比Hystrix的大
    socket-timeout-millis: 60000   #socket超时
ribbon:
  ReadTimeout: 10000
  ConnectTimeout: 10000

  

qq群:216868740

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-10-20
  • 2021-06-02
  • 2021-08-01
猜你喜欢
  • 2022-12-23
  • 2021-11-20
  • 2021-11-20
  • 2021-09-09
  • 2022-12-23
相关资源
相似解决方案