Microservices Architecture With Spring Boot

Gain Java Knowledge
11 min readOct 20, 2021

In tis article we are going to learn complete Microservices architecture using spring boot.

So, First I will create two microservices in spring boot.

1. Store service 2. Catalog Service.

After creating these two microservices. We will register these microservices into Service Registry.
After that we will create API gateway. So all the request come from client will traverse through API Gateway.

To track all microservices status or to return fallback messages if any microservice is down will use Resilience4j library and Circuit Breaker. Because some time our micro services are not working fine. we will define some amount of time. If we are not getting response in particular amount of time then we will call fallback api that will notify to client which microservice is not working.

After that we will implement Distributed log tracing to track the request in Microservices. We will use Zipkin and seluth library. So we can track the request by using TraceId. TraceId value will be remain same through all the microservices. It would be one per request.
Log Format will be [service-name, TraceId, SpanId]

We will use common place to hold common properties that will be used by multiple microservices. for that we will use cloud config server and will create one git repository and will save all common config there. We will read this common config by config server and give…

--

--

Gain Java Knowledge

The Java programming language is one of the most popular languages today. Stay up to date with news, certifications, free learning resources and much more.