Simple Implementation of Spring Cloud OpenFeign
Published in
2 min readDec 16, 2021
Background
As the name suggests, OpenFeign is an open-source project. It was initially developed by Netflix and then transferred to the open-source community.
Feign is a declarative rest client that creates a dynamic implementation of the interface that’s declared as FeignClient.
Implementation
We would need 3 services for this tutorial. Create each project from https://start.spring.io/.
- Eureka Server — Registry where the services will get registered
- Service 1 — Will make Feign call to another service. A Eureka Client.
- Service 2 — Another Eureka CLient.
We will create three Spring Boot projects and add Eureka Server and Eureka Client dependencies respectively.
Next, let’s add the feign dependencies in Service 1, I have named the service — student.
- Let’s add the maven dependency