I have been tinkering with different configurations to set the timeout value of my Zuul proxy (Spring Cloud version Dalston.SR2) - but find that many of these configuration have no impact on the timeout behavior. My understanding is that Dalston.SR2 using Apache HTTP Client, and not the Ribbon client - but have found that I am ONLY able to control the timeout behavior by explicitly forcing using of Ribbon. Please advise on the correct way to configure timeout - and if it is one of the below that I tried, it does not seem to work!
I disabled Hystrix timeout for all the below tests:
hystrix.command.default.execution.timeout.enabled=false
Does not change timeout behavior though I would have expected this is the 'default' way to configure:
zuul.host.connect-timeout-millis=3000
zuul.host.socket-timeout-millis=9000
This also does not change timeout behavior (Apache HTTP client configuration):
http.connection.timeout=3000
http.socket.timeout=9000
This DOES work - but I do not want to use the Ribbon client as I understand it has been deprecated:
ribbon.restclient.enabled=true
ribbon.ConnectTimeout=3000
ribbon.ReadTimeout=9000
The term "client" refers to the underlying HTTP client being used. There are 3 choices, OK HTTP, Apache HTTP, or the deprecated Netflix Rest Client. ribbon.* properties can be used with any of these clients, they do not only apply to the deprecated Netflix Rest Client.
zuul.host.* properties will only have an effect if you are not using Ribbon with Zuul, in other words if you are specifying a zuul.route.url property. When using Ribbon you should control the timeouts using the ribbon.* properties. There is no need to set ribbon.restclient.enabled=true if you do not want to use the deprecated client.
@ryanjbaxter I think it's important, Cound you add these words into offical document of Spring Cloud Netflix?
Which part specifically?
@ryanjbaxter Thanks for the clarification.
Why don't we have a document or somehow a source of all the Read timeout reasons and the proposed ways to solve them?
Like for example the kind of exceptions you may encounter, possible reasons for them, proposed ways to fix them. We can keep this here in github for people to contribute if they encounter something new/different.
One last point, how can I define the necessary timeout we should put for some property? I mean if I am to increase ribbon.ReadTimeout for example, how can I define the new value, what attributes should I take in consideration while increasing the socket/read timeout of ribbon or zuul?
Thanks again!
check this, it worked for me...
https://github.com/spring-cloud/spring-cloud-netflix/issues/321
After upgrading to "Dalston.SR2" only way I could get it work is by using following property but then I am not using Ribbon but using url i.e. zuul.route.url property
zuul.host.connectTimeoutMillis: 600000
zuul.host. socketTimeoutMillis: 600000
Most helpful comment
The term "client" refers to the underlying HTTP client being used. There are 3 choices, OK HTTP, Apache HTTP, or the deprecated Netflix Rest Client.
ribbon.*properties can be used with any of these clients, they do not only apply to the deprecated Netflix Rest Client.zuul.host.*properties will only have an effect if you are not using Ribbon with Zuul, in other words if you are specifying azuul.route.urlproperty. When using Ribbon you should control the timeouts using theribbon.*properties. There is no need to setribbon.restclient.enabled=trueif you do not want to use the deprecated client.