@ -142,7 +142,7 @@ To use Feign create an interface and annotate it.
@@ -142,7 +142,7 @@ To use Feign create an interface and annotate it.
It has pluggable annotation support including Feign annotations and JAX-RS annotations.
Feign also supports pluggable encoders and decoders.
Spring Cloud adds support for Spring MVC annotations and for using the same <code>HttpMessageConverters</code> used by default in Spring Web.
Spring Cloud integrates Ribbon and Eureka, as well as Spring Cloud LoadBalancer to provide a load-balanced http client when using Feign.</p>
Spring Cloud integrates Eureka, as well as Spring Cloud LoadBalancer to provide a load-balanced http client when using Feign.</p>
</div>
<divclass="sect2">
<h3id="netflix-feign-starter"><aclass="anchor"href="#netflix-feign-starter"></a><aclass="link"href="#netflix-feign-starter">1.1. How to Include Feign</a></h3>
@ -181,7 +181,7 @@ public interface StoreClient {
@@ -181,7 +181,7 @@ public interface StoreClient {
</div>
</div>
<divclass="paragraph">
<p>In the <code>@FeignClient</code> annotation the String value ("stores" above) is an arbitrary client name, which is used to create either a <ahref="https://github.com/Netflix/ribbon">Ribbon</a> load-balancer (see <ahref="#spring-cloud-ribbon">below for details of Ribbon support</a>) or <ahref="https://github.com/spring-cloud/spring-cloud-commons/blob/master/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/reactive/ReactiveLoadBalancer.java">Spring Cloud LoadBalancer</a>.
<p>In the <code>@FeignClient</code> annotation the String value ("stores" above) is an arbitrary client name, which is used to create a <ahref="https://github.com/spring-cloud/spring-cloud-commons/blob/master/spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/blocking/client/BlockingLoadBalancerClient.java">Spring Cloud LoadBalancer client</a>.
You can also specify a URL using the <code>url</code> attribute
(absolute value or just a hostname). The name of the bean in the
application context is the fully qualified name of the interface.
@ -193,22 +193,7 @@ of the <code>@FeignClient</code> annotation.</p>
@@ -193,22 +193,7 @@ of the <code>@FeignClient</code> annotation.</p>
for the "stores" service. If your application is a Eureka client then
it will resolve the service in the Eureka service registry. If you
don’t want to use Eureka, you can simply configure a list of servers
in your external configuration (see
<ahref="#spring-cloud-ribbon-without-eureka">above for example</a>).</p>
</div>
<divclass="admonitionblock warning">
<table>
<tr>
<tdclass="icon">
<iclass="fa icon-warning"title="Warning"></i>
</td>
<tdclass="content">
In order to maintain backward compatibility, is used as the default load-balancer implementation.
However, Spring Cloud Netflix Ribbon is now in maintenance mode, so we recommend using Spring Cloud LoadBalancer instead.
To do this, set the value of <code>spring.cloud.loadbalancer.ribbon.enabled</code> to <code>false</code>.
</td>
</tr>
</table>
in your external configuration.</p>
</div>
</div>
<divclass="sect2">
@ -295,7 +280,7 @@ public interface StoreClient {
@@ -295,7 +280,7 @@ public interface StoreClient {
</div>
</div>
<divclass="paragraph">
<p>Spring Cloud Netflix provides the following beans by default for feign (<code>BeanType</code> beanName: <code>ClassName</code>):</p>
<p>Spring Cloud OpenFeign provides the following beans by default for feign (<code>BeanType</code> beanName: <code>ClassName</code>):</p>
</div>
<divclass="ulist">
<ul>
@ -315,23 +300,11 @@ public interface StoreClient {
@@ -315,23 +300,11 @@ public interface StoreClient {
<p><code>Client</code> feignClient: if Ribbon is in the classpath and is enabled it is a <code>LoadBalancerFeignClient</code>, otherwise if Spring Cloud LoadBalancer is in the classpath, <code>FeignBlockingLoadBalancerClient</code> is used.
<p><code>Client</code> feignClient: if Spring Cloud LoadBalancer is in the classpath, <code>FeignBlockingLoadBalancerClient</code> is used.
If none of them is in the classpath, the default feign client is used.</p>
</li>
</ul>
</div>
<divclass="admonitionblock note">
<table>
<tr>
<tdclass="icon">
<iclass="fa icon-note"title="Note"></i>
</td>
<tdclass="content">
<code>spring-cloud-starter-openfeign</code> contains both <code>spring-cloud-starter-netflix-ribbon</code> and <code>spring-cloud-starter-loadbalancer</code>.
</td>
</tr>
</table>
</div>
<divclass="paragraph">
<p>The OkHttpClient and ApacheHttpClient feign clients can be used by setting <code>feign.okhttp.enabled</code> or <code>feign.httpclient.enabled</code> to <code>true</code>, respectively, and having them on the classpath.
You can customize the HTTP client used by providing a bean of either <code>org.apache.http.impl.client.CloseableHttpClient</code> when using Apache or <code>okhttp3.OkHttpClient</code> when using OK HTTP.</p>
@ -142,7 +142,7 @@ To use Feign create an interface and annotate it.
@@ -142,7 +142,7 @@ To use Feign create an interface and annotate it.
It has pluggable annotation support including Feign annotations and JAX-RS annotations.
Feign also supports pluggable encoders and decoders.
Spring Cloud adds support for Spring MVC annotations and for using the same <code>HttpMessageConverters</code> used by default in Spring Web.
Spring Cloud integrates Ribbon and Eureka, as well as Spring Cloud LoadBalancer to provide a load-balanced http client when using Feign.</p>
Spring Cloud integrates Eureka, as well as Spring Cloud LoadBalancer to provide a load-balanced http client when using Feign.</p>
</div>
<divclass="sect2">
<h3id="netflix-feign-starter"><aclass="anchor"href="#netflix-feign-starter"></a><aclass="link"href="#netflix-feign-starter">1.1. How to Include Feign</a></h3>
@ -181,7 +181,7 @@ public interface StoreClient {
@@ -181,7 +181,7 @@ public interface StoreClient {
</div>
</div>
<divclass="paragraph">
<p>In the <code>@FeignClient</code> annotation the String value ("stores" above) is an arbitrary client name, which is used to create either a <ahref="https://github.com/Netflix/ribbon">Ribbon</a> load-balancer (see <ahref="#spring-cloud-ribbon">below for details of Ribbon support</a>) or <ahref="https://github.com/spring-cloud/spring-cloud-commons/blob/master/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/reactive/ReactiveLoadBalancer.java">Spring Cloud LoadBalancer</a>.
<p>In the <code>@FeignClient</code> annotation the String value ("stores" above) is an arbitrary client name, which is used to create a <ahref="https://github.com/spring-cloud/spring-cloud-commons/blob/master/spring-cloud-loadbalancer/src/main/java/org/springframework/cloud/loadbalancer/blocking/client/BlockingLoadBalancerClient.java">Spring Cloud LoadBalancer client</a>.
You can also specify a URL using the <code>url</code> attribute
(absolute value or just a hostname). The name of the bean in the
application context is the fully qualified name of the interface.
@ -193,22 +193,7 @@ of the <code>@FeignClient</code> annotation.</p>
@@ -193,22 +193,7 @@ of the <code>@FeignClient</code> annotation.</p>
for the "stores" service. If your application is a Eureka client then
it will resolve the service in the Eureka service registry. If you
don’t want to use Eureka, you can simply configure a list of servers
in your external configuration (see
<ahref="#spring-cloud-ribbon-without-eureka">above for example</a>).</p>
</div>
<divclass="admonitionblock warning">
<table>
<tr>
<tdclass="icon">
<iclass="fa icon-warning"title="Warning"></i>
</td>
<tdclass="content">
In order to maintain backward compatibility, is used as the default load-balancer implementation.
However, Spring Cloud Netflix Ribbon is now in maintenance mode, so we recommend using Spring Cloud LoadBalancer instead.
To do this, set the value of <code>spring.cloud.loadbalancer.ribbon.enabled</code> to <code>false</code>.
</td>
</tr>
</table>
in your external configuration.</p>
</div>
</div>
<divclass="sect2">
@ -295,7 +280,7 @@ public interface StoreClient {
@@ -295,7 +280,7 @@ public interface StoreClient {
</div>
</div>
<divclass="paragraph">
<p>Spring Cloud Netflix provides the following beans by default for feign (<code>BeanType</code> beanName: <code>ClassName</code>):</p>
<p>Spring Cloud OpenFeign provides the following beans by default for feign (<code>BeanType</code> beanName: <code>ClassName</code>):</p>
</div>
<divclass="ulist">
<ul>
@ -315,23 +300,11 @@ public interface StoreClient {
@@ -315,23 +300,11 @@ public interface StoreClient {
<p><code>Client</code> feignClient: if Ribbon is in the classpath and is enabled it is a <code>LoadBalancerFeignClient</code>, otherwise if Spring Cloud LoadBalancer is in the classpath, <code>FeignBlockingLoadBalancerClient</code> is used.
<p><code>Client</code> feignClient: if Spring Cloud LoadBalancer is in the classpath, <code>FeignBlockingLoadBalancerClient</code> is used.
If none of them is in the classpath, the default feign client is used.</p>
</li>
</ul>
</div>
<divclass="admonitionblock note">
<table>
<tr>
<tdclass="icon">
<iclass="fa icon-note"title="Note"></i>
</td>
<tdclass="content">
<code>spring-cloud-starter-openfeign</code> contains both <code>spring-cloud-starter-netflix-ribbon</code> and <code>spring-cloud-starter-loadbalancer</code>.
</td>
</tr>
</table>
</div>
<divclass="paragraph">
<p>The OkHttpClient and ApacheHttpClient feign clients can be used by setting <code>feign.okhttp.enabled</code> or <code>feign.httpclient.enabled</code> to <code>true</code>, respectively, and having them on the classpath.
You can customize the HTTP client used by providing a bean of either <code>org.apache.http.impl.client.CloseableHttpClient</code> when using Apache or <code>okhttp3.OkHttpClient</code> when using OK HTTP.</p>