Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I set timeout configuration for feign or where can I find the configuration document? #590

Closed
aisensiy opened this issue Sep 10, 2017 · 5 comments

Comments

@aisensiy
Copy link

Right now the info is not enough.

@Ryan-Miao
Copy link

Some configuration is needed to add, like spring-cloud/spring-cloud-netflix#1612

@aisensiy
Copy link
Author

Thanks for your reply.

What is the relationship between OpenFeign/feign and spring-cloud-netflix? Right now I just use feign independently. I do not have the annotation @FeignClient. Does it mean I should use spring-cloud-feign instead of feign?

@Ryan-Miao
Copy link

Ryan-Miao commented Sep 12, 2017

I think the feign is just a wrapper of hystrix, so I just associate the hystrix doc: https://github.com/Netflix/Hystrix/wiki/Configuration
For the feign timeout config, here is my usage:

ConfigurationManager.getConfigInstance()
                .setProperty("hystrix.command.PhotoService#getToken(String,String,String).execution.isolation.thread.timeoutInMilliseconds", 7000);
 return Feign.builder()
                .decoder(new GsonDecoder())
                .encoder(new GsonEncoder())
                .options(new Request.Options(config.getConnectTimeoutMillis(), config.getReadTimeoutMillis()))
                .target(PhotoService.class, baseUrl);

@aisensiy
Copy link
Author

Thanks for you reply. It solved my problem.

@susongyan
Copy link

i find HystrixFeign just use FeignClient's configuration , so the HystrixCommand's timeout then the FeignClient's timeout config?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants