Sync docs from master to gh-pages

This commit is contained in:
Dave Syer
2015-04-17 09:38:29 +00:00
parent d5849171af
commit 116c66c14c

View File

@@ -475,7 +475,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<li><a href="#_status_page_and_health_indicator">Status Page and Health Indicator</a></li>
<li><a href="#_eureka_metadata_for_instances_and_clients">Eureka Metadata for Instances and Clients</a></li>
<li><a href="#_using_the_discoveryclient">Using the DiscoveryClient</a></li>
<li><a href="#_alternatives_to_the_discoveryclient">Alternatives to the DiscoveryClient</a></li>
<li><a href="#_alternatives_to_the_native_netflix_discoveryclient">Alternatives to the native Netflix DiscoveryClient</a></li>
<li><a href="#_why_is_it_so_slow_to_register_a_service">Why is it so Slow to Register a Service?</a></li>
</ul>
</li>
@@ -523,6 +523,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<ul class="sectlevel1">
<li><a href="#_quick_start_2">Quick Start</a></li>
<li><a href="#_addressing_an_instance">Addressing an Instance</a></li>
<li><a href="#_addressing_all_instances_of_a_service">Addressing all instances of a service</a></li>
<li><a href="#_customizing_the_amqp_connectionfactory_2">Customizing the AMQP ConnectionFactory</a></li>
</ul>
</li>
@@ -1924,9 +1925,9 @@ application, so it&#8217;s helpful if they are accurate.</p>
<div class="content">
<pre>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}}}</pre>
</div>
</div>
@@ -1996,7 +1997,7 @@ another <code>SmartLifecycle</code> with higher phase.</p>
</div>
</div>
<div class="sect2">
<h3 id="_alternatives_to_the_discoveryclient">Alternatives to the DiscoveryClient</h3>
<h3 id="_alternatives_to_the_native_netflix_discoveryclient">Alternatives to the native Netflix DiscoveryClient</h3>
<div class="paragraph">
<p>You don&#8217;t have to use the raw Netflix <code>DiscoveryClient</code> and usually it
is more convenient to use it behind a wrapper of some sort. Spring
@@ -2008,6 +2009,25 @@ can simply set <code>&lt;client&gt;.ribbon.listOfServers</code> to a comma-separ
list of physical addresses (or hostnames), where <code>&lt;client&gt;</code> is the ID
of the client.</p>
</div>
<div class="paragraph">
<p>You can also use the <code>org.springframework.cloud.client.discovery.DiscoveryClient</code>
which provides a simple API for discovery clients that is not specific
to Netflix, e.g.</p>
</div>
<div class="listingblock">
<div class="content">
<pre>@Autowired
private DiscoveryClient discoveryClient;
public String serviceUrl() {
List&lt;ServiceInstance&gt; list = client.getInstances("STORES");
if (list != null &amp;&amp; list.size() &gt; 0 ) {
return list.get(0).getUri();
}
return null;
}</pre>
</div>
</div>
</div>
<div class="sect2">
<h3 id="_why_is_it_so_slow_to_register_a_service">Why is it so Slow to Register a Service?</h3>
@@ -2834,6 +2854,24 @@ level, but "/myusers/**" matches hierarchically.</p>
</div>
</div>
<div class="paragraph">
<p>These simple url-routes doesn&#8217;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.</p>
</div>
<div class="listingblock">
<div class="title">application.yml</div>
<div class="content">
<pre class="highlight"><code class="language-yaml" data-lang="yaml"> zuul:
routes:
users:
path: /myusers/**
serviceId: users
users:
ribbon:
listOfServers: example.com,google.com</code></pre>
</div>
</div>
<div class="paragraph">
<p>To add a prefix to all mappings, set <code>zuul.prefix</code> to a value, such as
<code>/api</code>. 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:
</div>
</div>
<div class="sect1">
<h2 id="_addressing_all_instances_of_a_service">Addressing all instances of a service</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The "destination" parameter is used in a Spring <code>PathMatcher</code> (with the path separator as a colon <code>:</code>) to determine if an instance will process the message. Using the example from above, "/bus/refresh?destination=customers:**" will target all instances of the "customers" service regardless of the profiles and ports set as the <code>ApplicationContext</code> ID.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_customizing_the_amqp_connectionfactory_2">Customizing the AMQP ConnectionFactory</h2>
<div class="sectionbody">
<div class="paragraph">
@@ -3786,7 +3832,7 @@ ProxyAuthenticationProperties] for full details.</p>
</div>
<div id="footer">
<div id="footer-text">
Last updated 2015-04-03 17:11:26 UTC
Last updated 2015-04-17 09:37:32 UTC
</div>
</div>
</body>