feign icon indicating copy to clipboard operation
feign copied to clipboard

how to build a feign target with eureka-client?

Open silentAllay opened this issue 10 years ago • 6 comments

how to build a feign target with eureka-client? code like this: GitHub github = (GitHub)Feign.builder().target(GitHub.class, ${eureka-client-instance},${appName}); the ${eureka-client-instance} is the eureka-client instance the ${appName} is the target app which is registered in eureka-server.

silentAllay avatar Sep 19 '16 08:09 silentAllay

See the ribbon module documentation: https://github.com/OpenFeign/feign/tree/master/ribbon#usage

Something like this:

MyService api = Feign.builder().client(new RibbonClient()).target(MyService.class, "https://myAppProd");

spencergibb avatar Sep 19 '16 14:09 spencergibb

i also have the same to your problem!how to build a feign target with eureka-clien,would you fixed?please tell me solution,thank you very much

hao0111 avatar May 26 '17 06:05 hao0111

Hi @spencergibb, I checked the pom.xml and it's not using Eureka. Does the feign + ribbon solution use Eureka?

RaviH avatar Oct 08 '18 17:10 RaviH

is there any solution? i also have the same problem.

taihucao avatar May 30 '19 10:05 taihucao

It is possible. You will need to include ribbon-eureka in your application and provide the eureka information to the Ribbon client via the LBClientFactory option. You may need to write your own LBClientFactory to provide a Discover Enabled server.

kdavisk6 avatar May 30 '19 17:05 kdavisk6

hi @kdavisk6 do you have an example of how this could be done ? i.e providing the eureka information tot he Ribbon Client via LBClientfactory..

donaldfernandes avatar Oct 10 '20 20:10 donaldfernandes