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

假装没事ソ 提交于 2019-12-11 04:57:24

问题


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.


回答1:


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



回答2:


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




回答3:


Setting robbin readTime in zuul server should solve this problem.

ribbon:
  ReadTimeout: 60000

Note: ReadTimeout is case sentience. Hope it helps.



来源:https://stackoverflow.com/questions/55418340/com-netflix-zuul-exception-zuulexception-hystrix-readed-time-out

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!