Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Zuul - Gateway Timeout

I'm seeing a 504 response for a long request using the Spring Cloud Zuul gateway pattern. The timeout occurs exactly 1 minute after the request was issued.

I've tried the following to no avail:

zuul:
  ribbon:
    ConnectTimeout: 10000000
    ReadTimeout: 10000000

and:

hystrix:
  command:
    default:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 10000000

and

hystrix:
  command:
    default:
      execution:
        timeout:
          enabled: false

None of these prevents the gateway timeout after a minute.

like image 318
user1432403 Avatar asked May 13 '16 21:05

user1432403


People also ask

How do I increase timeout in Zuul gateway?

Ribbon Read Timeout Property ReadTimeout property will solve the problem. Add the following property to an application. properties file of your Zuul Api Gateway and restart your application. Note: The value is provided in milliseconds and that the property name is case-sensitive.

Which read timeout property set when Zuul uses Service Discovery?

If Zuul uses service discovery, you need to configure these timeouts with the ribbon. ReadTimeout and ribbon. SocketTimeout Ribbon properties.

What is difference between spring Cloud gateway and Zuul?

Zuul is built on servlet 2.5 (works with 3. x), using blocking APIs. It doesn't support any long lived connections, like websockets. Gateway is built on Spring Framework 5, Project Reactor and Spring Boot 2 using non-blocking APIs.

How configure Zuul API gateway in spring boot?

Creating Zuul Server ApplicationAdd the @EnableZuulProxy annotation on your main Spring Boot application. The @EnableZuulProxy annotation is used to make your Spring Boot application act as a Zuul Proxy server. You will have to add the Spring Cloud Starter Zuul dependency in our build configuration file.


1 Answers

It turned out to be the Idle timeout value of the AWS Elastic Load Balancer. I increased the idle timeout to 3 minutes and the problem went away.

like image 79
user1432403 Avatar answered Oct 20 '22 01:10

user1432403