com.netflix.zuul.exception.ZuulException: Hystrix Readed time out
Asked Answered
E

4

7

I am trying microservices with eureka and zuul. And there is a problem with all requests, which take more then 1 second. As I have understood, 1 second is default hystrix timeout, and for configuring timeouts in Zuul, I have to configure these properties:

hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds ribbon.ConnectTimeout
ribbon.ReadTimeout

but when I set them, there is "Cannot resolve configuration property ..." warning on each of them in the Intelije Idea. And, it seems, they are not applied and don't work.

Eleonoreleonora answered 29/3, 2019 at 13:19 Comment(0)
H
10

Setting ribbon readTime in zuul server should solve this problem.

ribbon:
  ReadTimeout: 60000

Note: ReadTimeout is case sensitive.

Heiser answered 22/9, 2019 at 7:6 Comment(1)
This fixed the issue .Thank YouBdellium
F
7

Add the following property in Zuul gateway service

hystrix:
   command:
      default:
         execution:
            iso lation:
               thread:
                  timeoutInMilliseconds: 30000


ribbon:
   ReadTimeout: 60000
   connection-timeout: 3000
   eureka:
      enabled: true


zuul:
   ignoredServices: '*'
   host:
      time-to-live: -1
      connect-timeout-millis: 5000
      max-per-route-connections: 10000
      max-total-connections: 5000
      socket-timeout-millis: 60000
   semaphore:
      max-semaphores: 500

Florez answered 1/9, 2019 at 9:54 Comment(1)
Thanks! Why Netflix uses two notations - ReadTimeout and connection-timeout?Pluviometer
D
2

Answer is edited

This way you will increase Hystrix timeout (globaly):

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

or per service:

hystrix:
  command:
    <serviceName>:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 5000
Dicta answered 2/4, 2019 at 0:47 Comment(3)
unfortunately, it is not working. and after "hystrix" available properties are only: "metrics" and "shareSecurityContext". There is no "command" propertyEleonoreleonora
Edited, try it now @VadosDicta
I am getting Gateway Timeout after 3 seconds event if I have increased the timeoutInMilliseconds to 10000Becquerel
W
0

In your application.properties of zuul server just add that variables:

hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 240000
ribbon.ConnectTimeout: 120000
ribbon.ReadTimeout: 120000

You can also refresh your project in Intellij.

Waltner answered 3/5, 2022 at 20:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.