Merge pull request #1743 from ryanjbaxter/disable-hystrix-feign

Disable Hystrix support when using Feign by default
This commit is contained in:
Ryan Baxter
2017-03-01 16:33:34 -05:00
committed by GitHub
8 changed files with 41 additions and 12 deletions

View File

@@ -1060,9 +1060,7 @@ NOTE: `PROD-SVC` is the name of the service the Clients will be making requests
[[spring-cloud-feign-hystrix]]
=== Feign Hystrix Support
If Hystrix is on the classpath, by default Feign will wrap all methods with a circuit breaker. Returning a `com.netflix.hystrix.HystrixCommand` is also available. This lets you use reactive patterns (with a call to `.toObservable()` or `.observe()` or asynchronous use (with a call to `.queue()`).
To disable Hystrix support for Feign, set `feign.hystrix.enabled=false`.
If Hystrix is on the classpath and `feign.hystrix.enabled=true`, Feign will wrap all methods with a circuit breaker. Returning a `com.netflix.hystrix.HystrixCommand` is also available. This lets you use reactive patterns (with a call to `.toObservable()` or `.observe()` or asynchronous use (with a call to `.queue()`).
To disable Hystrix support on a per-client basis create a vanilla `Feign.Builder` with the "prototype" scope, e.g.:
@@ -1078,6 +1076,10 @@ public class FooConfiguration {
}
----
WARNING: Prior to the Spring Cloud Dalston release, if Hystrix was on the classpath Feign would have wrapped
all methods in a circuit breaker by default. This default behavior was changed in Spring Cloud Dalston in
favor for an opt-in approach.
[[spring-cloud-feign-hystrix-fallback]]
=== Feign Hystrix Fallbacks