Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
As I understand, currently feign supports only Ribbon as client side loadbalancer, which is tight to Eureka.
Since we introduced DiscoveryClient interface, which may be k8s, predefined, etc and have clean interfaces like LoadBalancerClient/ServiceInstanceChooser and ReactiveLoadBalancer,
It will allows us to choose between different discovery mechanisms (I'm currently interested in k8s discovery) and provide a basic LB support for feign.
Hi @ArtyomGabeev This is a valid issue and a topic that has yet to be evaluated by the team, probably following a discussion and decisions on Ribbon replacement for the entire Spring Cloud stack (that's the issue to observe on this: spring-cloud/spring-cloud-commons#553 ). Once there's an alternative chosen/ created, we would have to provide it for our OpenFeign integration as well. If you're interested in working on this bit, we will be happy to get the contribution. Will get back to you after we've done some progress on the other issue.
Hi @Glosur . yes, we've merged a PR providing our own non-reactive LB client:
Hi @Glosur - as Hoxton is not a major release for SC OpenFeign, it's important to take into account that at this point, we need to start by adding Spring Cloud LoadBalancer to it without removing Ribbon. We have created all the necessary setup to use Spring Cloud LoadBalancer with both non-reactive and reactive setups - I guess for OpenFeign, for now, that would be the non-reactive version.
We have also created spring-cloud-starter-loadbalancer. After including it in your project, you will get a
If you carry this out with a project that previously worked with Ribbon, it will start failing as at various points in Feign Ribbon Client and other Ribbon dependencies are used explicitly; now, an alternative will have to be provided - for example, by switching to using a
I guess there would be more questions, so for further discussion, feel free to contact me at gitter.
* Add FeignBlockingLoadBalancerClient, configurations for default, apache httpclient and okhttp setup. Add autoconfiguration. Init fix for gh-177. * Fix SC loadbalancer dependencies. * Fix generating Feign response when instance not found. * Fix configuration. * Add tests for FeignBlockingLoadBalancerClient and FeignLoadBalancerAutoConfiguration. * Fix checkstyle and formatting. * Refactor, add docs and javadocs. * Fix author name. * Fix docs after code review.