Simple Implementation of Spring Cloud OpenFeign

Ruby Valappil
Javarevisited
Published in
2 min readDec 16, 2021

--

Spring Cloud OpenFeign
Photo by Toa Heftiba on Unsplash

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/.

  1. Eureka Server — Registry where the services will get registered
  2. Service 1 — Will make Feign call to another service. A Eureka Client.
  3. 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.

  1. Let’s add the maven dependency

--

--