From bd2473a7bf95bf5b75ef7e97042ea023af48699d Mon Sep 17 00:00:00 2001 From: mg Date: Fri, 4 Aug 2017 17:22:56 -0500 Subject: [PATCH] Update spring-cloud-netflix.adoc Update documentation to reflect https://github.com/spring-cloud/spring-cloud-netflix/issues/1048 --- .../main/asciidoc/spring-cloud-netflix.adoc | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/docs/src/main/asciidoc/spring-cloud-netflix.adoc b/docs/src/main/asciidoc/spring-cloud-netflix.adoc index 9052cc3d..60728853 100644 --- a/docs/src/main/asciidoc/spring-cloud-netflix.adoc +++ b/docs/src/main/asciidoc/spring-cloud-netflix.adoc @@ -833,6 +833,7 @@ To set the `IRule` for a service name `users` you could set the following: ---- users: ribbon: + NIWSServerListClassName: com.netflix.loadbalancer.ConfigurationBasedServerList NFLoadBalancerRuleClassName: com.netflix.loadbalancer.WeightedResponseTimeRule ---- @@ -1500,9 +1501,39 @@ The location of the backend can be specified as either a "serviceId" url: http://example.com/users_service ---- -These simple url-routes don't get executed as a `HystrixCommand` nor can you loadbalance multiple URLs with Ribbon. -To achieve this, specify a service-route and configure a Ribbon client for the -serviceId (this currently requires disabling Eureka support in Ribbon: +These simple url-routes don't get executed as a `HystrixCommand` nor do they loadbalance multiple URLs with Ribbon. +To achieve this, you can specify a `serviceId` with a static list of servers: + +.application.yml +[source,yaml] +---- +zuul: + routes: + echo: + path: /myusers/** + serviceId: myusers-service + stripPrefix: true + +hystrix: + command: + myusers-service: + execution: + isolation: + thread: + timeoutInMilliseconds: ... + +myusers-service: + ribbon: + NIWSServerListClassName: com.netflix.loadbalancer.ConfigurationBasedServerList + ListOfServers: http://example1.com,http://example2.com + ConnectTimeout: 1000 + ReadTimeout: 3000 + MaxTotalHttpConnections: 500 + MaxConnectionsPerHost: 100 +---- + +Another method is specifiying a service-route and configure a Ribbon client for the +serviceId (this requires disabling Eureka support in Ribbon: see <>), e.g. .application.yml