Basic use of Spring Cloud OpenFeign

This project provides OpenFeign integration for Spring Boot applications through automatic configuration and binding to the Spring Environment and other Spring programming models.

1. Declarative REST client: Feign

Feign is a declarative Web services client. It makes it easier to write Web service clients. Create and annotate an interface using Feign. 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 supports using the same HttpMessageConverters used by default in Spring Web. Spring Cloud integrates Eureka, Spring Cloud CircuitBreaker, and Spring Cloud LoadBalancer to provide a load-balancing HTTP client when using Feign.

1.1. How to integrate Feign

To Feign included in your project, please use a group org. Springframework. Cloud and an artifact ID spring – the cloud – starter – openfeign starter. For more information about building a system with the current Spring Cloud Release Train setup, see the Spring Cloud Project page.

Example:

@SpringBootApplication
@EnableFeignClients
public class Application {

    public static void main(String[] args) { SpringApplication.run(Application.class, args); }}Copy the code

StoreClient.java

@FeignClient("stores")
public interface StoreClient {
    @RequestMapping(method = RequestMethod.GET, value = "/stores")
    List<Store> getStores(a);

    @RequestMapping(method = RequestMethod.GET, value = "/stores")
    Page<Store> getStores(Pageable pageable);

    @RequestMapping(method = RequestMethod.POST, value = "/stores/{storeId}", consumes = "application/json")
    Store update(@PathVariable("storeId") Long storeId, Store store);
}
Copy the code

In the @FeignClient annotation, the String value (” stores “above) is any client name used to create the Spring Cloud LoadBalancer client. You can also specify the URL using the URL attribute (absolute value or just hostname). The name of the bean in the application context is the fully qualified name of the interface. To specify your own alias value, you can use the qualifier value of the @FeignClient annotation.

The load balancer client above will want to discover the physical address of the “Stores” service. If your application is a Eureka client, it will resolve the services in the Eureka service registry. If you don’t want to use Eureka, you can configure the server list in the external configuration using SimpleDiscoveryClient.

To use the @enableFeignClients annotation on @configuration-Annotated -classes, be sure to specify the location of the client, for example: @enableFeignClients (basePackages = “com.example.clients”) or list them explicitly: @ EnableFeignClients (clients = InventoryServiceFeignClient. Class)

1.2. Override the Feign defaults

One of the core concepts supported by Feign in Spring Cloud is named clients. Each Feign client is part of a collection of components that work together to contact remote servers as needed, and the collection has a name that you can specify as an application developer using the @FeignClient annotation. Spring Cloud using FeignClientsConfiguration named for each client according to the need to create a new integration as the ApplicationContext. This contains (among other things) a Feign.decoder, a Feign.encoder, and a feign.contract. The name of the collection can be overridden with the contextId attribute of the @FeignClient annotation.

Spring Cloud allows you to additional configuration by using the @ FeignClient statement (on FeignClientsConfiguration) to fully control feign client. Example:

@FeignClient(name = "stores", configuration = FooConfiguration.class)
public interface StoreClient {
    / /..
}
Copy the code

In this case, the customer comprised FeignClientsConfiguration already in the component and any components of FooConfiguration (which will cover the former).

FooConfiguration does not need to be annotated with @Configuration. However, if it is, then be careful to exclude it from any @ComponentScan that includes this configuration, because when specified it will be the default source for Feign.decoder, Feign.encoder, Feign.contract, and so on. This can be avoided by placing it in a separate, non-overlapping package from any @ComponentScan or @SpringBootApplication, or it can be explicitly excluded from @ComponentScan.

In addition to changing the name of the ApplicationContext collection, use the contextId attribute of the @FeignClient annotation, which overwrites the alias of the client name and will be used as part of the name of the configuration bean created by the client.

The name and URL attributes support placeholders.

@FeignClient(name = "${feign.name}", url = "${feign.url}")
public interface StoreClient {
    / /..
}
Copy the code

Spring Cloud OpenFeign provides feign with the following bean (BeanType beanName: ClassName) by default:

  • DecoderfeignDecoder: ResponseEntityDecoder(Packaged oneSpringDecoder)
  • EncoderFeignEncoder:SpringEncoder
  • LoggerFeignLogger:Slf4jLogger
  • MicrometerCapabilityMicrometerCapability: iffeign-micrometerOn the classpath andMeterRegistryavailable
  • ContractFeignContract:SpringMvcContract
  • Feign.BuilderFeignBuilder:FeignCircuitBreaker.Builder
  • ClientFeignClient: If Spring Cloud LoadBalancer is on the classpath,FeignBlockingLoadBalancerClientIs used. If they are not on the classpath, the default Feign client is used.

Spring-cloud-starter -openfeign supports spring-cloud-starter-loadbalancer. However, as an optional dependency, you need to be sure to add it to your project if you want to use it.

OkHttpClient and ApacheHttpClient as well as the ApacheHC5 Feign client can be used by setting feign.okhttp.enabled or feign.httpClient. enabled or Feign. Httpclient. Hc5. Enabled is set to true, respectively, and put them in the class path to use. You can provide org. When using Apache. The Apache HTTP. Impl. Client. CloseableHttpClient or okhttp3 OkHttpClient when using HTTP or OK Org. Apache. Hc. Client5. HTTP. Impl. Be provided with the classic bean from definition to use HTTP client. CloseableHttpClient with Apache HC5.

Spring Cloud OpenFeign does not provide the following beans for Feign by default, but still looks for these types of beans from the application context to create feign clients:

  • Logger.Level
  • Retryer
  • ErrorDecoder
  • Request.Options
  • Collection<RequestInterceptor>
  • SetterFactory
  • QueryMapEncoder
  • Capability (MicrometerCapability is provided by default)

By default, a Retryer.NEVER_RETRY bean of type Retryer is created, which disables retry. Note that this retry behavior differs from the default behavior of Feign in that it automatically retries IOExceptions as net-related transient exceptions and any Retryableexceptions thrown from the ErrorDecoder.

Creating a bean of one of these types and placing it in the @FeignClient configuration (such as the FooConfiguration above) allows you to override each of the beans described.

Example:

@Configuration
public class FooConfiguration {
    @Bean
    public Contract feignContract(a) {
        return new feign.Contract.Default();
    }

    @Bean
    public BasicAuthRequestInterceptor basicAuthRequestInterceptor(a) {
        return new BasicAuthRequestInterceptor("user"."password"); }}Copy the code

This replaces SpringMvcContract with feign.contract. Default and adds RequestInterceptor to the collection of RequestInterceptors.

@feignClient can also be configured using configuration properties.

application.yml

feign:
    client:
        config:
            feignName:
                connectTimeout: 5000
                readTimeout: 5000
                loggerLevel: full
                errorDecoder: com.example.SimpleErrorDecoder
                retryer: com.example.SimpleRetryer
                defaultQueryParameters:
                    query: queryValue
                defaultRequestHeaders:
                    header: headerValue
                requestInterceptors:
                    - com.example.FooRequestInterceptor
                    - com.example.BarRequestInterceptor
                decode404: false
                encoder: com.example.SimpleEncoder
                decoder: com.example.SimpleDecoder
                contract: com.example.SimpleContract
                capabilities:
                    - com.example.FooCapability
                    - com.example.BarCapability
                metrics.enabled: false
Copy the code

The defaultConfiguration 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.

If you prefer to use configuration properties to configure all @FeignClients, you can create configuration properties using the default Feign name.

You can use feign. Client. Config. FeignName. DefaultQueryParameters and feign. Client. Config. FeignName. DefaultRequestHeaders to specified will be called The query parameters and header that the feignName client sends with each request.

application.yml

feign:
    client:
        config:
            default:
                connectTimeout: 5000
                readTimeout: 5000
                loggerLevel: basic
Copy the code

If we create both @Configuration Bean and Configuration property, the Configuration property will win. It will override the @Configuration value. But if you want to change the priority to @configuration, you can change feign.client.default-to-properties to false.

If we want to create multiple Feign clients with the same name or URL so that they point to the same server but each has a different custom configuration, we must use the contextId attribute of @FeignClient to avoid name-clashing beans for these configurations.

@FeignClient(contextId = "fooClient", name = "stores", configuration = FooConfiguration.class)
public interface FooClient {
    / /..
}
Copy the code
@FeignClient(contextId = "barClient", name = "stores", configuration = BarConfiguration.class)
public interface BarClient {
    / /..
}
Copy the code

FeignClient can also be configured not to inherit beans from the parent context. You can override the FeignClientConfigurer inheritParentConfiguration of bean () returns false to achieve this:

@Configuration
public class CustomConfiguration{

@Bean
public FeignClientConfigurer feignClientConfigurer(a) {
            return new FeignClientConfigurer() {

                @Override
                public boolean inheritParentConfiguration(a) {
                    return false; }}; }}Copy the code

By default, the Feign client does not encode slashes/characters. You can change this behavior by setting feign.client.decodeslash to false.

1.2.1. SpringEncoder configuration

In the SpringEncoder we provide, we set the empty character set for binary content types and UTF-8 for all other types.

You can modify this behavior to derive a character set from the Content-Type header character set by setting feign.encoder. Charset-from-content-type to true.

1.3. Timeout handling

We can configure timeouts on the default client and named client. OpenFeign uses two timeout parameters:

  • connectTimeoutPrevents the caller from blocking due to server processing time.
  • readTimeoutStarts when the connection is established and fires when the return response time is too long.

If the server is not running or unavailable, the packet causes the connection to be rejected. The communication ends with an error message or a fallback. If it is set very low, this may happen before connectTimeout. The time it takes to perform the lookup and receiving of such packets accounts for a large part of this delay. It may change depending on the remote host involved in the DNS lookup.

1.4. Manually create the Feign client

In some cases, you may need to customize your Feign Client in ways that are not possible using the above methods. In this case, you can create the client using the Feign Builder API. Here is an example that creates two Feign clients with the same interface, but configures a separate request interceptor for each client.

@Import(FeignClientsConfiguration.class)
class FooController {

    private FooClient fooClient;

    private FooClient adminClient;

    @Autowired
    public FooController(Client client, Encoder encoder, Decoder decoder, Contract contract, MicrometerCapability micrometerCapability) {
        this.fooClient = Feign.builder().client(client)
                .encoder(encoder)
                .decoder(decoder)
                .contract(contract)
                .addCapability(micrometerCapability)
                .requestInterceptor(new BasicAuthRequestInterceptor("user"."user"))
                .target(FooClient.class, "https://PROD-SVC");

        this.adminClient = Feign.builder().client(client)
                .encoder(encoder)
                .decoder(decoder)
                .contract(contract)
                .addCapability(micrometerCapability)
                .requestInterceptor(new BasicAuthRequestInterceptor("admin"."admin"))
                .target(FooClient.class, "https://PROD-SVC"); }}Copy the code

In the example above FeignClientsConfiguration. Class is Spring Cloud OpenFeign provide a default configuration.

Prod-svc is the name of the service to which the client will make a request.

The Feign Contract object defines which annotations and values are valid on the interface. Autowiring Contract beans provide support for SpringMVC annotations instead of the default Feign native annotations.

You can also use Builder to configure FeignClient to not inherit beans from the parent context. You can do this by overriding the call inheritParentContext(false) on the Builder.

1.5. Feign Spring Cloud circuit breaker support

If the Spring Cloud CircuitBreaker on the class path and feign. CircuitBreaker, enabled = true, feign will use the circuit breaker all packing method. To disable Spring Cloud CircuitBreaker support on a per-client basis, create a Vanilla Feign.Builder with the “Prototype” scope, for example:

@Configuration
public class FooConfiguration {
    @Bean
    @Scope("prototype")
    public Feign.Builder feignBuilder(a) {
        returnFeign.builder(); }}Copy the code

Circuit breaker names follow this pattern #(). When @feignClient with FooClient interface is called and the interface method called without arguments is bar, the breaker name will be FooClient#bar().

As of 2020.0.2, the circuit breaker name mode has changed from _. Using 2020.0.4 introduced in CircuitBreakerNameResolver, name of circuit breaker can keep the old model.

Provide CircuitBreakerNameResolver bean, you can change the circuit breaker name pattern.

@Configuration
public class FooConfiguration {
    @Bean
    public CircuitBreakerNameResolver circuitBreakerNameResolver(a) {
        return(String feignClientName, Target<? > target, Method method) -> feignClientName +"_"+ method.getName(); }}Copy the code

To enable the Spring Cloud CircuitBreaker group, please will feign. The CircuitBreaker. Group. The enabled attribute set to true (the default is false).

1.6. Feign Spring Cloud Circuit breaker Fallbacks

Spring Cloud CircuitBreaker supports the concept of fallback: the default code path to execute when a circuit is open or an error occurs. To enable fallback for a given @FeignClient, set the fallback property to the name of the class that implemented the fallback. You also need to declare your implementation as a Spring bean.

@FeignClient(name = "test", url = "http://localhost:${server.port}/", fallback = Fallback.class)
    protected interface TestClient {

        @RequestMapping(method = RequestMethod.GET, value = "/hello")
        Hello getHello(a);

        @RequestMapping(method = RequestMethod.GET, value = "/hellonotfound")
        String getException(a);

    }

    @Component
    static class Fallback implements TestClient {

        @Override
        public Hello getHello(a) {
            throw new NoFallbackAvailableException("Boom!".new RuntimeException());
        }

        @Override
        public String getException(a) {
            return "Fixed response"; }}Copy the code

If one needs access to the cause that made the fallback trigger, one can use the fallbackFactory attribute inside @FeignClient.

@FeignClient(name = "testClientWithFactory", url = "http://localhost:${server.port}/", fallbackFactory = TestFallbackFactory.class)
    protected interface TestClientWithFactory {

        @RequestMapping(method = RequestMethod.GET, value = "/hello")
        Hello getHello(a);

        @RequestMapping(method = RequestMethod.GET, value = "/hellonotfound")
        String getException(a);

    }

    @Component
    static class TestFallbackFactory implements FallbackFactory<FallbackWithFactory> {

        @Override
        public FallbackWithFactory create(Throwable cause) {
            return newFallbackWithFactory(); }}static class FallbackWithFactory implements TestClientWithFactory {

        @Override
        public Hello getHello(a) {
            throw new NoFallbackAvailableException("Boom!".new RuntimeException());
        }

        @Override
        public String getException(a) {
            return "Fixed response"; }}Copy the code

1.7. Feign and @ Primary

When Feign is used with the Spring Cloud CircuitBreaker Fallback, there are multiple beans of the same type in the ApplicationContext. This will cause @AutoWired to not work because there is not a bean, or a bean marked as primary. To solve this problem, Spring Cloud OpenFeign marks all Feign instances as @primary, so the Spring Framework will know which bean to inject. In some cases, this may not be desirable. To turn this behavior off, set the main property of @FeignClient to false.

@FeignClient(name = "hello", primary = false)
public interface HelloClient {
    // methods here
}
Copy the code

1.8. Feign inheritance support

Feign supports boilerplate apis through a single inheritance interface. This allows common operations to be grouped into a convenient base interface.

UserService.java

public interface UserService {

    @RequestMapping(method = RequestMethod.GET, value ="/users/{id}")
    User getUser(@PathVariable("id") long id);
}
Copy the code

UserResource.java

@RestController
public class UserResource implements UserService {}Copy the code

UserClient.java

package project.user;

@FeignClient("users")
public interface UserClient extends UserService {}Copy the code

It is generally not recommended to share an interface between the server and the client. It introduces tight coupling and is not supported by all maintained versions of Spring MVC (some versions do not inherit method parameter mapping).

1.9. Feign request/response compression

You can consider enabling request or response GZIP compression for your Feign requests. You can do this by enabling one of the following properties:

feign.compression.request.enabled=true
feign.compression.response.enabled=true
Copy the code

Feign request compression gives you Settings similar to what you set up for your Web server:

feign.compression.request.enabled=true
feign.compression.request.mime-types=text/xml,application/xml,application/json
feign.compression.request.min-request-size=2048
Copy the code

These properties allow you to select the compressed media type and the minimum request threshold length.

For HTTP clients other than OkHttpClient, the default GZIP decoder can be enabled to decode utF-8 encoded GZIP responses:

feign.compression.response.enabled=true
feign.compression.response.useGzipDecoder=true
Copy the code

1.10. Feign logging

Create a logger for each Feign client you create. By default, the logger name is the full class name of the interface used to create the Feign client. Feign Logging responds only to the DEBUG level.

application.yml

logging.level.project.user.UserClient: DEBUG
Copy the code

The Logger.Level object that you configure for each client tells Feign how much to log. Options are:

  • NONE, no logging (default).
  • BASIC, only the request method and URL as well as the response status code and execution time are recorded.
  • HEADERS, and records basic information as well as request and response headers.
  • FULLTo record the headers, body, and metadata of the request and response.

For example, the following sets logger. Level to FULL:

@Configuration
public class FooConfiguration {
    @Bean
    Logger.Level feignLoggerLevel(a) {
        returnLogger.Level.FULL; }}Copy the code

1.11. Feign Capability support

The Feign feature exposes the core Feign components so that they can be modified. For example, a function can take a client, decorate it, and return the decorated instance to Feign. The support for indicator libraries is a good real-world example. See Feign metrics.

Creating one or more Capability beans and placing them in the @FeignClient configuration allows you to register them and modify the behavior of the associated clients.

@Configuration
public class FooConfiguration {
    @Bean
    Capability customCapability(a) {
        return newCustomCapability(); }}Copy the code

1.12. Feign indicators

If all of the following conditions are true, the MicrometerCapability Bean is created and registered so that your Feign client can publish metrics to Micrometer:

  • feign-micrometerOn the classpath
  • A MeterRegistryThe bean is available
  • Feign metric property set to true (default)
    • feign.metrics.enabled=true(For all clients)
    • feign.client.config.feignName.metrics.enabled=true(Acting on a single client)

If your application already uses Micrometer, enabling metrics is as simple as putting Feign-Micrometer into your classpath.

You can also disable this feature in any of the following ways:

  • Exclude feign-Micrometer from your classpath
  • Set one of the Feign metrics properties to false
    • feign.metrics.enabled=false
    • feign.client.config.feignName.metrics.enabled=false

Feign. Metrics. Enabled = false to disable support for all feign client measurement, regardless of the level of the client sign value: feign. Client. Config. FeignName. Metrics. The enabled. If you want to enable or disable merics to each client, please don’t set the feign. Metrics, enabled and use feign. Client. Config. FeignName. Metrics. Enabled.

You can also customize MicrometerCapability by registering your own beans:

@Configuration
public class FooConfiguration {
    @Bean
    public MicrometerCapability micrometerCapability(MeterRegistry meterRegistry) {
        return newMicrometerCapability(meterRegistry); }}Copy the code

1.13. Feign@QueryMap support

The OpenFeign@QueryMap annotation enables poJOs to be used as GET parameter mappings. Unfortunately, the default OpenFeign QueryMap annotation is incompatible with Spring because it lacks the value attribute.

Spring Cloud OpenFeign provides an equivalent @SpringQueryMap annotation for annotating POJO or Map parameters as query parameter mappings.

Such as:

The Params class defines parameters param1 and param2:

// Params.java
public class Params {
    private String param1;
    private String param2;

    // [Getters and setters omitted for brevity]
}
Copy the code

The following Feign clients use the Params class by using the @SpringQueryMap annotation:

@FeignClient("demo")
public interface DemoTemplate {

    @GetMapping(path = "/demo")
    String demoEndpoint(@SpringQueryMap Params params);
}
Copy the code

If you need more control over the generated query parameter mapping, you can implement a custom QueryMapEncoder bean.

1.14. Bases for support

Spring provides apis to create REST representations that follow the HATEOAS principle, Spring HATEOAS, and Spring Data REST.

If your project USES org. Springframework. The boot: spring – the boot – starter – bases for the starter or Org. Springframework. The boot: spring – the boot – starter – data – rest starter, is enabled by default Feign bases for support.

With HATEOAS support enabled, the Feign client is allowed to serialize and deserialize the HATEOAS representation models: EntityModel, CollectionModel, and PagedModel.

@FeignClient("demo")
public interface DemoTemplate {

    @GetMapping(path = "/stores")
    CollectionModel<Store> getStores(a);
}
Copy the code

1.15. Spring @MatrixVariable support

Spring Cloud OpenFeign provides support for Spring @MatrixVariable annotations.

If the map is passed as a method parameter, the @MatrixVariable path segment is created by using key-value pairs in the = join map.

If different objects are passed, the names provided in the @MatrixVariable annotation (if defined) or the annotated variable names are concatenated with the provided method parameters using =.

Even on the server side, Spring does not require users to name the path segment placeholder with the same name as the matrix variable because it is too vague on the client side, Spring Cloud OpenFeign requires that you add a path segment placeholder that matches the name provided in the @MatrixVariable annotation (if defined) or the annotated variable name.

Such as:

@GetMapping("/objects/links/{matrixVars}")
Map<String, List<String>> getObjects(@MatrixVariable Map<String, List<String>> matrixVars);
Copy the code

Note that both the variable name and the path segment placeholder are called matrixVars.

@FeignClient("demo")
public interface DemoTemplate {

    @GetMapping(path = "/stores")
    CollectionModel<Store> getStores(a);
}
Copy the code

1.16. Feign CollectionFormat support

We support feign.collectionFormat by providing the @collectionFormat annotation. You can annotate feIGN client methods by passing the desired feign.CollectionFormat as an annotation value.

In the following example, the CSV format is used instead of the default EXPLODED method to handle the method.

@FeignClient(name = "demo")
    protected interface PageableFeignClient {

        @CollectionFormat(feign.CollectionFormat.CSV)
        @GetMapping(path = "/page")
        ResponseEntity performRequest(Pageable page);

    }
Copy the code

Set the CSV format when sending Pageable as a query parameter for correct encoding.

1.17. Reactive support

Since the OpenFeign project does not currently support responsive clients such as Spring WebClient, neither does Spring Cloud OpenFeign. We will add support for it to the core project as soon as possible.

Until completed, we recommend using Feign-Reactive to support Spring WebClient.

1.17.1. Early initialization error

Depending on how you use the Feign client, you may see initialization errors when you start the application. To solve this problem, you can use ObjectProvider when autoloading the client.

@Autowired
ObjectProvider<TestFeginClient> testFeginClient;
Copy the code

1.18. The Spring Data support

You can consider enabling Jackson Modules to support org. Springframework. Data. Domain. The Page and org. Springframework. Data. Domain. The Sort decoding.

feign.autoconfiguration.jackson.enabled=true
Copy the code

1.19. Spring@refreshScope support

If Feign client refresh is enabled, each Feign client is created using feign.request. Options as the bean of the refresh scope. This means that properties such as connectTimeout and readTimeout can be refreshed for any Feign client instance via POST /actuator/ Refresh.

By default, the refresh behavior in the Feign client is disabled. Enable the refresh behavior with the following properties:

feign.client.refresh-enabled=true
Copy the code

Do not annotate the @FeignClient interface with the @refreshScope annotation.

2. Configure properties

You can specify various properties in the application.properties file, application.yml file, or command line switch. This appendix provides a list of common Spring Cloud OpenFeign attributes and references to the underlying classes that use them.

Attribute contributions can come from other JAR files on the classpath, so you shouldn’t think of this as an exhaustive list. In addition, you can define your own attributes.

The name of the The default value describe
feign.autoconfiguration.jackson.enabled false If true, PageJacksonModule and SortJacksonModule beans will be provided for Jackson page decoding.
feign.circuitbreaker.enabled false If true, the OpenFeign client will use Spring Cloud CircuitBreaker breaker packaging.
feign.circuitbreaker.group.enabled false If true, the OpenFeign client will be wrapped with Spring Cloud CircuitBreaker with a group.
feign.client.config
feign.client.decode-slash true The Feign client does not encode slashes/characters by default. To change this behavior, set decodeSlash to false.
feign.client.default-config default
feign.client.default-to-properties true
feign.client.refresh-enabled false Enable option value refresh for Feign.
feign.compression.request.enabled false Enables requests sent by Feign to be compressed.
feign.compression.request.mime-types [text/xml, application/xml, application/json] List of supported MIME types.
feign.compression.request.min-request-size 2048 Minimum threshold content size.
feign.compression.response.enabled false Enables the response from Feign to be compressed.
feign.compression.response.useGzipDecoder false Enable the default GZIP decoder to use.
feign.encoder.charset-from-content-type false Indicates whether the character set should be derived from the {@code content-type} header.
feign.httpclient.connection-timeout 2000
feign.httpclient.connection-timer-repeat 3000
feign.httpclient.disable-ssl-validation false
feign.httpclient.enabled true Allow Feign to use the Apache HTTP client.
feign.httpclient.follow-redirects true
feign.httpclient.hc5.enabled false Allow Feign to use Apache HTTP Client 5.
feign.httpclient.hc5.pool-concurrency-policy Pool concurrency strategy.
feign.httpclient.hc5.pool-reuse-policy Pool connection reuse policy.
feign.httpclient.hc5.socket-timeout 5 Default value of Socket timeout.
feign.httpclient.hc5.socket-timeout-unit Default value of the Socket timeout unit.
feign.httpclient.max-connections 200
feign.httpclient.max-connections-per-route 50
feign.httpclient.time-to-live 900
feign.httpclient.time-to-live-unit
feign.metrics.enabled true Enable metrics for Feign.
feign.okhttp.enabled false Allow Feign to use the OK HTTP Client.