Spring Zuul - 网关超时

use*_*403 5 java spring netflix-zuul

我看到使用 Spring Cloud Zuul 网关模式的长请求的 504 响应。发出请求后恰好 1 分钟发生超时。

我尝试了以下方法无济于事:

zuul:
  ribbon:
    ConnectTimeout: 10000000
    ReadTimeout: 10000000
Run Code Online (Sandbox Code Playgroud)

和:

hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 10000000
Run Code Online (Sandbox Code Playgroud)

和

hystrix:
  command:
    default:
      execution:
        timeout:
          enabled: false
Run Code Online (Sandbox Code Playgroud)

这些都不能阻止网关在一分钟后超时。

use*_*403 5

结果是 AWS Elastic Load Balancer 的空闲超时值。我将空闲超时增加到 3 分钟,问题就消失了。


max*_*lay 1

尝试这个不同的配置:

# Disable Hystrix timeout globally (for all services)
#hystrix.command.default.execution.timeout.enabled: false

# Disable Hystrix timeout for a single service
#hystrix.command.<serviceName>.execution.timeout.enabled: false

# Increase the Hystrix timeout to 60s (globally)
#hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 60000

# Increase the Hystrix timeout to 60s (per service)
#hystrix.command.<serviceName>.execution.isolation.thread.timeoutInMilliseconds: 60000
Run Code Online (Sandbox Code Playgroud)