Zuul网关报错com.netflix.zuul.exception.ZuulException: Forwarding error的解决方法

在给某个方法加了双重循环后,请求时网关报了

com.netflix.zuul.exception.ZuulException: Forwarding error

com.netflix.client.ClientException: null

java.lang.RuntimeException: java.net.SocketTimeoutException: Read timed out

java.net.SocketTimeoutException: Read timed out

控制台截图
Zuul网关报错com.netflix.zuul.exception.ZuulException: Forwarding error的解决方法_第1张图片

 经查原因是zuul的调用等待时间超时,需要在application.yml设置超时连接时长

需要加上(具体时长视情况而定)

ribbon:
  ReadTimeout: 60000
  ConnectTimeout: 60000
zuul:
  host:
    connect-timeout-millis: 60000
    socket-timeout-millis: 60000
hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000

 

你可能感兴趣的:(SpringCloud)