spring-cloud/spring-cloud-openfeign

Request.Options configuration per method request

IgorGudkov opened this issue · 2 comments

I know that it is possible to configure specific feign configs by client name or default ones, using Spring like:

spring.cloud.openfeign.client.config.MyClient.connect-timeout=1000
spring.cloud.openfeign.client.config.MyClient.read-timeout=2000

or

spring.cloud.openfeign.client.config.default.connect-timeout=1000
spring.cloud.openfeign.client.config.default.read-timeout=2000

I would like to know if spring-cloud supports the configuration per method name or request like

spring.cloud.openfeign.client.config.MyClient#getSomething(String).connect-timeout=1000
spring.cloud.openfeign.client.config.MyClient#getSomething(String).read-timeout=2000

If this is already supported, what is the correct syntax?

I asked same question on OpenFeign and I got worked solution, since OpenFeign supports Options for the requested method and apply them during request.
But I want to customize all Feign methods through a property file. Thanks for answer in advance.

I think it is not possible. Because beans are created per client. What you can do is you can create a new Client you want to change and move your methods to there.

Hello @IgorGudkov, this is not supported in SC OpenFeign. The project is currently under maintenance (we suggest switching to Spring Interface Clients) and we're not planning much active development.