All properties
Every property spring_boot_starter_feign reads. All but one are per client: spring.feign.client.config.<name>.<key>, where <name> is the client's @FeignClient name (or its contextId), and default applies to every client. The starter's metadata (lib/spring_gen/spring_metadata.json) lists the same 17 keys.
Why
Clients differ by service and by environment: URLs, timeouts, logging, credentials. Properties change them without a build. This page lists every key with its type and default, so you can check one without reading every page.
Example
# lib/resources/application.yml
catalog:
url: https://api.neon.books
spring:
feign:
client:
decode-slash: true
config:
default:
connect-timeout: 2s
read-timeout: 10s
call-timeout: 15s
logger-level: basic
sensitive-headers: X-Api-Key
default-request-headers:
X-Shop: neon
catalog:
url: ${catalog.url}
dismiss404: true
follow-redirects: false
retryer: catalogRetryer
error-decoder: ShopErrors
request-interceptors:
- requestIds
default-query-parameters:
lang: en
orders:
read-timeout: 30s
event-stream:
reconnect: true
reconnect-delay: 3s
max-attempts: 10
The same in .properties:
# lib/resources/application.properties
catalog.url=https://api.neon.books
spring.feign.client.decode-slash=true
spring.feign.client.config.default.connect-timeout=2s
spring.feign.client.config.default.read-timeout=10s
spring.feign.client.config.default.call-timeout=15s
spring.feign.client.config.default.logger-level=basic
spring.feign.client.config.default.sensitive-headers=X-Api-Key
spring.feign.client.config.default.default-request-headers.X-Shop=neon
spring.feign.client.config.catalog.url=${catalog.url}
spring.feign.client.config.catalog.dismiss404=true
spring.feign.client.config.catalog.follow-redirects=false
spring.feign.client.config.catalog.retryer=catalogRetryer
spring.feign.client.config.catalog.error-decoder=ShopErrors
spring.feign.client.config.catalog.request-interceptors[0]=requestIds
spring.feign.client.config.catalog.default-query-parameters.lang=en
spring.feign.client.config.orders.read-timeout=30s
spring.feign.client.config.orders.event-stream.reconnect=true
spring.feign.client.config.orders.event-stream.reconnect-delay=3s
spring.feign.client.config.orders.event-stream.max-attempts=10
Writing values
- Durations:
500ms,10s,1m, ISO 8601 (PT1M) or a plain number of milliseconds.0means none forread-timeout,connect-timeoutandcall-timeout. See Durations. - On/off values (
dismiss404,follow-redirects,event-stream.reconnect,decode-slash):true/falsein any case,on/off,yes/no,1/0. Another value stops the application, naming the key. - Lists: comma separated (
a,b), indexed ([0],[1]) or a YAML list.
Per client: spring.feign.client.config
| Key | Type | Default | Meaning |
|---|---|---|---|
url |
String |
none | The base URL when @FeignClient(url:) is empty; http:// is added when the scheme is missing. ${...} placeholders are allowed. A client without any URL stops the start. |
connect-timeout |
Duration |
10s |
Under default only: the connect timeout of the transport all clients share. 0 for none. |
read-timeout |
Duration |
60s |
The longest wait for the response, then between two chunks of the body; not a limit for the whole call. 0 for none. For an event stream, only the wait for the headers. |
call-timeout |
Duration |
none | The longest one call may take in all: every attempt, the pauses of the Retryer and the wait for the answer. 0 or less: none. Never retried when it passes. |
logger-level |
none, basic, headers, full |
none |
How much of each call is logged, under the logger feign.<Interface> at debug level. none: nothing, not even failed connections and retries; basic: method, URL, status, time, failures, retries, reconnects; headers: plus headers, credentials masked; full: plus bodies. |
dismiss404 |
bool |
false |
A 404 gives null (or a ResponseEntity) instead of an exception; void methods still throw. @FeignClient(dismiss404: true) does the same. |
follow-redirects |
bool |
true |
Follows redirects; with false a 3xx answer is an error. |
default-request-headers.<Name> |
List<String> |
none | Headers sent when the request has none of that name once the interceptors ran; default's and the client's are merged, the client's winning for the same name. A comma list or an indexed list gives several values. |
default-query-parameters.<name> |
List<String> |
none | The same for query parameters. The URL with its query is in the log lines and in exception messages, so prefer a header for a secret. |
retryer |
String |
none: never retries | The client's Retryer: a bean name, or a class name matching the type of exactly one bean. Wins over the beans. |
error-decoder |
String |
DefaultErrorDecoder |
The client's ErrorDecoder: a bean name, or a class name matching the type of exactly one bean. |
request-interceptors |
List<String> |
none | More RequestInterceptor beans, by bean name or class name: default's, then the client's, after those the client has anyway. |
sensitive-headers |
List<String> |
none | More headers whose values the headers and full logs show as *** (names in any case): default's, then the client's. Authorization, Proxy-Authorization, Cookie, Set-Cookie and DPoP always are. |
event-stream.reconnect |
bool |
true |
An EventStream<T> method connects again when the connection ends. |
event-stream.reconnect-delay |
Duration |
3s, or the server's retry: |
The wait before connecting again. |
event-stream.max-attempts |
int |
no limit | How many connections in a row may end without an event before the stream gives up. |
Each key is written spring.feign.client.config.<name>.<key>, for example spring.feign.client.config.catalog.read-timeout=5s.
spring.feign.client: for all clients
| Key | Type | Default | Meaning |
|---|---|---|---|
spring.feign.client.decode-slash |
bool |
true |
false encodes / in path variables as %2F. One setting for all clients. |
How values combine
| Kind | Rule |
|---|---|
Single values (url, timeouts, logger-level, dismiss404, follow-redirects, retryer, error-decoder, event-stream.*) |
The client's key wins over default's. @FeignClient(url:) wins over url. |
default-request-headers, default-query-parameters |
Merged; the client's win for the same name. |
request-interceptors, sensitive-headers |
Added: default's, then the client's. |
connect-timeout |
Read under default only. |
Read from other packages
| Key | Package | Meaning |
|---|---|---|
logging.level.feign |
logging | Must be debug for the logger-level lines to show. |
server.request-timeout |
spring_boot_starter_web | The deadline of a web request; a Feign call made while handling it is limited by it too. |
In Spring (Java)
The keys are Spring Cloud OpenFeign's, under spring.feign instead of spring.cloud.openfeign; a spring.cloud.openfeign.* key stops the start and names the new one. call-timeout, sensitive-headers and event-stream.* are additions; connect-timeout is read under default only. Spring's decoder, encoder, contract, capabilities and micrometer keys have no counterpart.