by BehindJava

What is Spring Cloud API Gateway in MicroService Architecture

Home » microservices » What is Spring Cloud API Gateway in MicroService Architecture

In this tutorial we are going to learn in detail about the Spring Cloud API Gateway and its creation using Spring Boot.

Spring Cloud API Gateway aims to provide a simple, yet effective way to route to APIs and provide cross cutting concerns to them such as: security, monitoring/metrics, and resiliency.

Spring Cloud Gateway comes with an inbuilt load balancer that distributes requests coming from a client application equally between the running instances of the Users Microservices which makes our API more robust when the load on our system increases.

springcloudapi

Spring Cloud API Gateway will be a central point of entry to a system that has multiple instances of micro services running behind the API Gateway and it fetches the list of addresses of running microservices from the Eureka Server.

The added advantages of using Spring Cloud API Gateway is Filters that filters all the incoming and outgoing HTTP requests from the API Gateway and we can develop our own custom filters where we can write up a code to perform any business logic that you need.

For example, we can use HTTP Header from HTTP request and can validate the JWT token to make sure it is valid and we can also configure custom routing to route a request to a specific destination which we will learn in the next tutorial.