Rupali Gupta
3 min readJun 21, 2021

--

Microsevices architecture with Spring Boot

The foundation of Microsevices architecture lies in developing a single application as a suite of small and independent service that run in their own process, developed and deployed independently.

Microservices are an important approach to help make continuous delivery or deployment of large, complex applications possible.

The Microsevice architecture can be designed using below template

Essential components of Microsevices:

Creating Microsevices architecture

Spring cloud Netflix Eureka
(Registration service) — Directory for all APIs

Eureka is a resilient service registery implementation. Eureka Server is an application that holds the information about all client-service applications. Every Micro service will register into the Eureka server and Eureka server knows all the client applications running on each port and IP address. Eureka Server is also known as Discovery Server. Client-side service discovery allows services to find and communicate with each other without hard-coding hostname and port. The only ‘fixed point' in such an architecture consists of a service registry with which each service has to register.

Spring cloud Gateway — Single entry point for APIs

Spring Cloud Gateway is API Gateway implementation by Spring Cloud on top of Spring reactive ecosystem. It consists of the following building blocks-
Route: Think of it as the destination that we want to route a particular request to route to.
Predicate: This is similar to Java 8 Function Predicate. Using this functionality we can match HTTP request, such as headers , url, cookies or parameters.

Filter: These are instances Spring Framework Gateway Filter. Using this we can modify the request or response as per the requirement.

Spring cloud Netflix Hysterix — Re-router /circuit breaker

In Microsevice architecture , it is common to have multiple layers of service calls. With Hystrix we can handle each API call and it’s failure routing. So, if one micro service call fails the entire system will not stop responding. Intezaar of giving 500 error it will route to a failover mechanism.

Spring Cloud Config Server

The configuration service is an essential part of Microsevice architecture. It is more like externalizing properties/resource file out of project codebase to an external service altogether so that any changes to any given property does not require the re-deployment of service which is using that property. All such property changes will be reflected without redeploying the microservice.

Spring Boot Java microservice

Below is the sample Microservice containing APIs which integrate with all other mentioned components..

More on Eurkea peering (Spring Cloud Netflix Eureka)

https://github.com/Netflix/eureka/wiki/Understanding-Eureka-Peer-to-Peer-Communication

--

--

Rupali Gupta

I am a technologist with passion for sketching and creativity. I have more than 17 years of experience in IT industry majorly in investment banking domains.