Ability to configure client to send default headers #284 at 2.2.x (#420)

* Implemented ability to provide default query parameters and headers to feign clients.
Issue was mentioned in №284

* Removed wrong names of test data. Replaced with correct ones.

* Thread sleep was repalced with more verbose TimeUnit sleep

* Fixed more names of the clients.
This commit is contained in:
Ilia Ilinykh
2020-10-29 17:58:38 +03:00
committed by GitHub
parent bc6c3b7bf2
commit 93327fcace
5 changed files with 142 additions and 8 deletions

View File

@@ -175,6 +175,10 @@ feign:
loggerLevel: full
errorDecoder: com.example.SimpleErrorDecoder
retryer: com.example.SimpleRetryer
defaultQueryParameters:
query: queryValue
defaultRequestHeaders:
header: headerValue
requestInterceptors:
- com.example.FooRequestInterceptor
- com.example.BarRequestInterceptor
@@ -188,6 +192,8 @@ Default configurations can be specified in the `@EnableFeignClients` attribute `
If you prefer using configuration properties to configured all `@FeignClient`, you can create configuration properties with `default` feign name.
You can use `feign.client.config.feignName.defaultQueryParameters` and `feign.client.config.feignName.defaultRequestHeaders` to specify query parameters and headers that will be sent with every request of the client named `feignName`.
application.yml
[source,yaml]
----