From 8814da3b783eb96a998d0a63439c06410d07c1b1 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Tue, 22 Nov 2016 15:39:13 -0500 Subject: [PATCH] Document how to use thread isolation with hystrix and feign. Fixes #1191. --- .../main/asciidoc/spring-cloud-netflix.adoc | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/src/main/asciidoc/spring-cloud-netflix.adoc b/docs/src/main/asciidoc/spring-cloud-netflix.adoc index f7fbbc5b..78ad8a63 100644 --- a/docs/src/main/asciidoc/spring-cloud-netflix.adoc +++ b/docs/src/main/asciidoc/spring-cloud-netflix.adoc @@ -970,6 +970,26 @@ This replaces the `SpringMvcContract` with `feign.Contract.Default` and adds a ` Default configurations can be specified in the `@EnableFeignClients` attribute `defaultConfiguration` in a similar manner as described above. The difference is that this configuration will apply to _all_ feign clients. +NOTE: If you need to use `ThreadLocal` bound variables in your `RequestInterceptor`s you will need to either set the +thread isolation strategy for Hystrix to `SEMAPHORE` or disable Hystrix in Feign. + +application.yml +[source,yaml] +---- +# To disable Hystrix in Feign +feign: + hystrix: + enabled: false + +# To set thread isolation to SEMAPHORE +hystrix: + command: + default: + execution: + isolation: + strategy: SEMAPHORE +---- + === Creating Feign Clients Manually In some cases it might be necessary to customize your Feign Clients in a way that is not