Feign overview
Feign is a declarative Web service client, making it very easy to write Web service clients, just create an interface and add annotations on it.
Feign is designed to make it easier to write Java HTTP clients.
When using ribbon+resttemplate, the encapsulation processing of HTTP requests by Resttemplate is used to form a set of templated calling methods. However, in real-world development, because the invocation of service dependency may be more than one place, often an interface will be called more than one, so it is common for each microservices to encapsulate some of the client classes to wrap up the invocation of these services. So feign is further encapsulated on this basis, and he helps us define and implement the definition of the dependent service interface. With the implementation of feign, we only need to create an interface and configure it using annotations to complete the interface binding to the service provider, simplifying the amount of development that automatically encapsulates the service invocation client when using the Spring Cloud Ribbon.
The feign integrates the Ribbon to maintain a list of services and load balancing of clients through the Ribbon. Feign only needs to define the service binding interface and implement the service invocation gracefully and simply in a declarative way.
Springcloud Learning (5)--feign load Balancing