Testing in Postman

Now run all the 3 applications. Let’s test our API. Hit the following URL

http://localhost:9090/demo/gfg

And you are going to get a response like this

Now we can get the same response by using our API gateway port which is 8085. Now hit the following URL

http://localhost:8085/demo/gfg

And you are going to get a response like this

So this is how the API gateway works. If you have hundreds of microservices then you don’t need to remember the port of all microservices. You can just configure them in your API Gateway and you can access all your API by using only one port. And this is our eureka dashboard.



Java Spring Boot Microservices – Integration of Eureka and Spring Cloud Gateway

Microservices are small, loosely coupled distributed services. Microservices architecture evolved as a solution to the scalability, independently deployable, and innovation challenges with Monolithic Architecture. It provides us to take a big application and break it into efficiently manageable small components with some specified responsibilities. It is considered the building block of modern applications.

Similar Reads

What is Eureka?

Service Discovery is one of the major things of a microservice-based architecture. Eureka is the Netflix Service Discovery Server and Client. The server can be configured and deployed to be highly functional, with each server copying the state of the registered services to the others....

What is Spring Cloud Gateway?

Spring Cloud Gateway provides a library for making API gateways on top of Spring and Java. It provides a flexible way of routing requests based on a number of criteria, as well as focuses on cross-cutting problems like security, resiliency, and monitoring. Some of the important features of Spring Cloud Gateway are:...

Developing Service Discovery using Eureka

To develop a Service Discovery using Eureka, please refer to this article Java Spring Boot Microservices – Developing Service Discovery....

Developing API Gateway Using Spring Cloud Gateway

Step 1: Create a New Spring Boot Project in Spring Initializr...

Develop the DEMO-SERVICE

...

Testing in Postman

To create a new service, please refer to How to Create a Spring Boot Project in Spring Initializr and Run it in IntelliJ IDEA. For this project choose the following things...