is a declarative web service client. It makes writing web service clients easier. To use Feign, create an interface and annotate it. It has pluggable annotation support including Feign and JAX-RS annotations. Feign Spring Cloud adds support for Spring MVC annotations and for using the same HttpMessageConverters used by default in Spring Web. Spring Cloud integrates Ribbon and Eureka to provide a load balanced HTTP client when using Feign. (https://cloud.spring.io) Creating a Feign client in Spring cloud is simple, all you have to do is to create an interface and annotate it with . @FeignClient Requests generated by Feign clients can have configurations, for example how to encode, decode and intercept requests. Consider a Feign client that must be used with different configurations at different places in the code, or multiple Feign clients that each must be used with its own configuration. For example Feign client A must be configured with decoder A and request interceptor A and Feign client B with decoder B and interceptor B. One possible scenario is setting different authentication approaches for different Feign clients. Let’s get our hands dirty: Suppose there are two Rest API, one for getting “Bar” objects on Bar server and another for getting “Foo” Objects on Foo server. The problem is that those services have different authentication approaches. We have two Feign clients for two services, FooClient and BarClient. These Feign clients need to adopt different authentication configuration. Here is the class. The has a , and specific and is configured in class. FooClient FeignClient fooContextId value url FooConfig (contextId = , value = , url = , configuration = FooConfig.class) { ( ) ; } @FeignClient "fooContextId" "fooValue" "http://foo-server.com/services" public interface FooFeignClient @GetMapping "{id}/foo" Long id) void getFoo (@PathVariable( ) "id" And this is the class. Again, it has its own specific , , and . BarClient contextId value url BarConfig (contextId = , value = , url = , configuration = BarConfig.class) { ( ) ; } @FeignClient "barContextId" "barValue" "http://bar-server.com/services" public interface BarFeignClient @GetMapping "{id}/bar" Long id) void getBar (@PathVariable( ) "id" and should not be annotated with or any other Spring bean annotations. BarConfig FooConfig @Component Next, we should instantiate and beans in these configuration classes. BarRequestInterceptor FooRequestInterceptor { { BarRequestInterceptor(); } } { { FooRequestInterceptor(); } } public class BarConfig @Bean BarRequestInterceptor public barRequestInterceptor () return new public class FooConfig @Bean FooRequestInterceptor public fooRequestInterceptor () return new Both and classes implement and must override apply method to specify their own authentication approaches. BarRequestInterceptor FooRequestInterceptor RequestInterceptor { Logger LOGGER = LoggerFactory.getLogger(BarRequestInterceptor.class); { template.header( , ); LOGGER.info( ); } } { Logger LOGGER = LoggerFactory.getLogger(FooRequestInterceptor.class); { template.header( , ); LOGGER.info( ); } } public class BarRequestInterceptor implements RequestInterceptor private static final @Override public void apply (RequestTemplate template) "authorization" "auth-bar" "bar authentication applied" public class FooRequestInterceptor implements RequestInterceptor private static final @Override public void apply (RequestTemplate template) "authorization" "auth-foo" "foo authentication applied" Finally, create a method to call these Feign clients: { Logger LOGGER = LoggerFactory.getLogger(HomeController.class); FooFeignClient fooFeignClient; BarFeignClient barFeignClient; ( ) { { LOGGER.info( ); fooFeignClient.getFoo( ); } (Exception e) { } { LOGGER.info( ); barFeignClient.getBar( ); } (Exception e) { } } } @RestController public class HomeController private static final @Autowired private @Autowired private @GetMapping "test" public void home () try "calling getFoo" 100L catch try "calling getBar" 100L catch If we run the application and call the home controller, first “getFoo” method of with will be invoked and then “bar” method of with . This is output log of this request: FooClient FooConfiguration BarClient BarConfiguration - - : : INFO --- [nio- -exec- ] com.example.feignconfig.HomeController : calling getFoo - - : : INFO --- [nio- -exec- ] c.e.f.foo.FooRequestInterceptor : foo authentication applied - - : : INFO --- [nio- -exec- ] com.example.feignconfig.HomeController : calling getBar - - : : INFO --- [nio- -exec- ] c.e.f.bar.BarRequestInterceptor : bar authentication applied 2019 11 28 22 33 17.041 18208 8080 1 2019 11 28 22 33 17.046 18208 8080 1 2019 11 28 22 33 17.472 18208 8080 1 2019 11 28 22 33 17.473 18208 8080 1 You can find source code of this tutorial on my GitHub repository: https://github.com/shokri4971/multiple-feign-config