Hi guys, Got another use case: Ability to add a timeout value for a route instead of a default timeout value. Not all backend services have the same timeout, some can have less and some can have large timeouts.

zuul:
  routes:
    users:
      path: /users/service
      url: http://user-service
      timeout: 20000
    orders:
      path: /orders/service
      url: http://order-service

In the above example users will have a timeout of 20000 milliseconds while the orders will have a default timeout value.

Around the same note, it would be nice to have a map object with each route. It would make customization so much easier and different properties could be attached to routes and used for multiple purposes.

I can do the PR for these if you guys agree.

Cheers!

Comment From: ryanjbaxter

I wondering if this is only a problem when not using Ribbon. With Ribbon you should be able to specify the timeout for a given service. However when not using Ribbon, I don't think we have a way of doing this. Have you looked into whether this is possible using Ribbon?

Comment From: msamad

Hi, Not using Ribbon, just wanted to have this functionality without Ribbon.

Comment From: ryanjbaxter

So one approach you could take is to use Ribbon but use the a static server list. Then you can set timeouts for specific ribbon services.

Comment From: indrabasak

If you are using hystrix, here is an example for setting different timeouts for different routes:

hystrix:
    users:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 10000
    orders:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 5000

Comment From: msamad

Thanks @ryanjbaxter and @indrabasak I was hoping to somehow setup timeout without using Ribbon or any other component. Would be nice to be able to set up timeout when specifying the routes so config is at one place instead of spread into different components.

Comment From: indrabasak

@msamad As far as I know, this is the only way for setting up timeouts. The requests are controlled by Hystrix or Ribbon.

Comment From: ryanjbaxter

@msamad I dont see why using Ribbon's list of servers property would not work for you. Can you explain?

http://cloud.spring.io/spring-cloud-static/Dalston.SR3/#spring-cloud-ribbon-without-eureka

Then you could use clientname.ribbon.ConnectTimeout and clientname.ribbon.ReadTimeout.

Comment From: msamad

Thanks @ryanjbaxter. I am not using Ribbon at all, may be I should start using it. I'll give it a try.

Cheers!

Comment From: idatta84

@ryanjbaxter this link http://cloud.spring.io/spring-cloud-static/Dalston.SR3/#spring-cloud-ribbon-without-eureka is no longer valid. Do you know if this solution is still valid ?

Comment From: ryanjbaxter

Ribbon and Zuul are no longer supported, so no its no longer valid.

Comment From: idatta84

@ryanjbaxter do you know of any other solution for this ?

Comment From: ryanjbaxter

Are you using Zuul?

Comment From: idatta84

yes using zuul but not eureka

Comment From: ryanjbaxter

Here is a working link, https://docs.spring.io/spring-cloud-netflix/docs/2.2.9.RELEASE/reference/html/#spring-cloud-ribbon-without-eureka

However note that we no longer support this