diff --git a/spring-cloud.html b/spring-cloud.html
index fd57d22..942d785 100644
--- a/spring-cloud.html
+++ b/spring-cloud.html
@@ -475,7 +475,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
eureka:
instance:
+ hostname: ${vcap.application.uris[0]}
+ nonSecurePort: 80
metadataMap:
- hostname: ${vcap.application.uris[0]}
- nonSecurePort: 80
instanceId: ${vcap.application.instance_id:${spring.application.name}:${spring.application.instance_id:${server.port}}}
@@ -1996,7 +1997,7 @@ another
-
Alternatives to the DiscoveryClient
+
Alternatives to the native Netflix DiscoveryClient
You don’t have to use the raw Netflix DiscoveryClient and usually it
is more convenient to use it behind a wrapper of some sort. Spring
@@ -2008,6 +2009,25 @@ can simply set <client>.ribbon.listOfServers to a comma-separ
list of physical addresses (or hostnames), where <client> is the ID
of the client.
+
+
You can also use the org.springframework.cloud.client.discovery.DiscoveryClient
+which provides a simple API for discovery clients that is not specific
+to Netflix, e.g.
+
+
+
+
@Autowired
+private DiscoveryClient discoveryClient;
+
+public String serviceUrl() {
+ List<ServiceInstance> list = client.getInstances("STORES");
+ if (list != null && list.size() > 0 ) {
+ return list.get(0).getUri();
+ }
+ return null;
+}
+
+
+
These simple url-routes doesn’t get executed as HystrixCommand nor can you loadbalance multiple url with Ribbon.
+To achieve this specify a service-route and configure a Ribbon client for the serviceId, e.g.
+
+
To add a prefix to all mappings, set zuul.prefix to a value, such as
/api. The proxy prefix is stripped from the request before the
request is forwarded by default (switch this behaviour off with
@@ -3084,6 +3122,14 @@ info: