Spring Cloud Gateway - SirajChaudhary/comprehensive-example-on-microservices-using-spring-boot-with-spring-cloud GitHub Wiki

Spring Cloud 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.

Step1: Add spring cloud gateway dependency in pom.xml in api-gateway microservice

<!-- spring cloud starter gateway -->
<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>

Step2: Add spring cloud gateway properties in application.yml in api-gateway microservice

spring:
  cloud:
    gateway:
      discovery:
        locator:
          enabled: 'true'
          # MICROSERVICE NAMES IN EUREKA SERVER WILL BE HANDLED IN LOWERCASE
          lower-case-service-id: 'true'

Step3: You can filter request & response in the gateway. here is an example

⚠️ **GitHub.com Fallback** ⚠️