If you prefer using configuration properties to configured all @FeignClient, you can create configuration properties with default feign name. It's also possible to set these timeouts per specific client by naming the client. And, we could, of course, list a global setting and also per-client overrides together without a problem.
My client:
@FeignClient( contextId = "fooFeignClient", name = "foo-client", url = "${foo.url}",
fallbackFactory = FooFallBackFactory.class,
configuration = FooFeignConfiguration.class)
I'm trying to do this and I want foo-client.readTimeout to override default.readTimeout when I'm using foo-client:
feign:
hystrix:
enabled: true
client:
config:
default:
connectTimeout: 3000
readTimeout: 3000
loggerLevel: full
foo-client:
connectTimeout: 3000
readTimeout: 5000
hystrix:
command:
default:
execution:
timeout:
enabled: "false"
isolation:
strategy: "THREAD"
thread:
timeoutInMilliseconds: "3000"
But this is not happening. I'm not sure if Hystrix's timeoutInMilliseconds could be impacting, but from my tests, it's not interfering. I want the feign.readTimeout to be 5000 only for the foo-client, not for the other clients. But it looks like it is ignoring this foo-client configuration and using only the default configuration.
I know it's not a @Configuration class problem because the Feign documentation says that if we create both @Configuration bean and configuration properties, configuration properties will win.