Sync docs from master to gh-pages
This commit is contained in:
@@ -687,7 +687,7 @@ For instance, Eureka’s supported statuses are <code>UP</code>, <code>DOWN<
|
||||
<div class="sect2">
|
||||
<h3 id="_spring_resttemplate_as_a_load_balancer_client"><a class="link" href="#_spring_resttemplate_as_a_load_balancer_client">Spring RestTemplate as a Load Balancer Client</a></h3>
|
||||
<div class="paragraph">
|
||||
<p><code>RestTemplate</code> can be automatically configured to use ribbon.
|
||||
<p><code>RestTemplate</code> can be automatically configured to use a Load-balancer client under the hood.
|
||||
To create a load-balanced <code>RestTemplate</code>, create a <code>RestTemplate</code> <code>@Bean</code> and use the <code>@LoadBalanced</code> qualifier, as shown in the following example:</p>
|
||||
</div>
|
||||
<div class="listingblock">
|
||||
@@ -731,6 +731,35 @@ Individual applications must create it.
|
||||
The Ribbon client is used to create a full physical address.
|
||||
See <a href="https://github.com/spring-cloud/spring-cloud-netflix/blob/master/spring-cloud-netflix-ribbon/src/main/java/org/springframework/cloud/netflix/ribbon/RibbonAutoConfiguration.java">RibbonAutoConfiguration</a> for details of how the <code>RestTemplate</code> is set up.</p>
|
||||
</div>
|
||||
<div class="admonitionblock important">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-important" title="Important"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
In order to use a load-balanced <code>RestTemplate</code>, you need to have a load-balancer implementation in your classpath.
|
||||
The recommended implementation is <code>BlockingLoadBalancerClient</code>
|
||||
- add <code>org.springframework.cloud:spring-cloud-loadbalancer</code> in order to use it.
|
||||
The
|
||||
<code>RibbonLoadBalancerClient</code> also can be used, but it’s now under maintenance and we do not recommend adding it to new projects.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="admonitionblock warning">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="icon">
|
||||
<i class="fa icon-warning" title="Warning"></i>
|
||||
</td>
|
||||
<td class="content">
|
||||
If you want to use <code>BlockingLoadBalancerClient</code>, make sure you do not have
|
||||
<code>RibbonLoadBalancerClient</code> in the project classpath, as for backward compatibility reasons, it will be used by default.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sect2">
|
||||
<h3 id="_spring_webclient_as_a_load_balancer_client"><a class="link" href="#_spring_webclient_as_a_load_balancer_client">Spring WebClient as a Load Balancer Client</a></h3>
|
||||
|
||||
Reference in New Issue
Block a user