Overriding Feign defaults

The default configuration is used by each Spring Cloud Feign using FeignClientsConfiguration. Spring Cloud creates a new configuration context on-demand for each named client using the FeignClientsConfiguration file. This configuration file has almost all the required attributes of FeignClient, such as feign.Decoder, feign.Encoder, and feign.Contract. But Spring Cloud allows you to override these configuration attributes by adding an additional configuration file on top of FeignClientsConfiguration.

Spring Cloud Netflix provides the following beans as default configurations for Feign:

  • Decoder feignDecoder: ResponseEntityDecoder class provides feignDecode bean
  • Encoder feignEncoder: SpringEncoder class provides

Get Mastering Spring Boot 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.