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.