I'm quite new to Feign. Just discover it today ... My first question when i read about Spring Cloud Feign is : "how do you package your feign client ?"
I'm taking an example. Suppose we have 2 microservices M1 and M2. M2 consume a endpoint from M1.
We can for example, build 2 jars for M1 :
- the first one will be the microservice itself.
- the second one can be the Feign client of M1, exposing the services.
In this solution, I saw an analogy with EJB2 stub and skeleton parts. And I saw another possible advantage : the Feign client is always in sync (v1) with the implementation (v1).
or do you only declare the Feign client inside the M2 microservices. That is if a third microservice need M1, it will also declare a Feign client (that can be a little different because its needs are different).
Perhaps I'm totally wrong, please correct me.
Thanks a lot ! Bye