Spring Cloud Feign

a declarative HTTP client developed by Netflix.

Cheav Sovannarith
Java Epic
1 min readSep 23, 2019

--

Feign is a declarative web service client. It makes writing web service clients easier.

Feign aims at simplifying HTTP API clients. Simply put, the developer needs only to declare and annotate an interface while the actual implementation will be provisioned at run-time.

project structures :

user-service

There are a Interface implement from JpaRepository

and a class RestController

Before We have Spring Cloud Feign, we can use RestTemple or other tools.

feign-client

dependency need for feign-client

We create a feign-client interface with exact same URI to which service we would call to.

Note : Placeholders are supported in the name and url attributes.

Once created interface UserServiceProxy already, we can get it to used by simply inject its bean.

SOURCE CODE : spring-cloud-feign-example

READ MORE

--

--