Building Microservices [PART-1]: Inter-S ...

Building Microservices [PART-1]: Inter-Service Communication with RestClient & HttpInterfa

Nov 23, 2024

Are you new to microservices? Struggling to understand how to create services, how they communicate with each other, how to secure them using JWT, integrate an API gateway, log and monitor your services, containerize them, or deploy them to a Kubernetes cluster? Don’t worry, this microservices series is just for you.

I will cover all these topics step by step using a small project example — Health Provider Appointment System.

I will cover below topics as a part of this series:

✅ Build Microservices
✅ Inter-Service Communication synchronously using RestClient and HttpInterfaces
✅ Inter-Service Communication asynchronously using message queue Kafka
✅ Secure Microservices using JWT
✅ Spring Cloud Gateway (API Gateway)
✅ Service Registry & Discovery (Eureka Server)
✅ Resilence4J Circuit Breaker
✅ Distributed Tracing (Spring Cloud Sluth & Zipkin)
✅ ELK Stack for Logging & Monitoring
✅ Containerization of Microservices
✅ Deployment on Kubernetes Cluster using Minikube/Docker Desktop single node cluster

image

✅ Architecture of Health Provider Appointment System Project

In this architecture, the API gateway acts as a single entry point. Every request passes through the API gateway, which interacts with the Auth Service to authenticate the request. If authentication is successful, the API gateway routes the request to the appropriate microservice. For instance, when the api/v1/appointments endpoint is called, the API gateway, after authentication, forwards the request to the Appointment Service. The Appointment Service then communicates with the Health Provider Service to check the provider's availability.

The Auth Service acts as the authentication service, responsible for issuing JWT tokens and validation.

So here we can see we need below microservices to create first:

➡️ Health Provider Service ( Let’s run on port: 9091)
➡️ Appointment Service ( Let’s run on port: 9090)
➡️ Auth Service ( Let’s run on port: 9093)

Read the full article here 👇

https://medium.com/gitconnected/building-microservices-part-1-inter-service-communication-with-restclient-httpinterface-and-d6ce48841111

¿Te gusta esta publicación?

Comprar Zeeshan Adil un café

Más de Zeeshan Adil