1. Concept library
  2. Java & Spring Boot
  3. Module 11: Microservices

Concept

Spring Cloud Gateway

An API gateway is the single entry point in front of your services: it routes requests by path, applies cross-cutting concerns such as authentication, rate limits and headers, and hides the internal topology.

What a session covers

The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.

  1. Explain what a gateway does and what it hides
  2. Route requests by path and add a cross-cutting filter
  3. Spot business logic in a gateway filter

In practice

A few lines that show Spring Cloud Gateway doing its job.

YAML
spring:
  cloud:
    gateway:
      routes:
        - id: orders
          uri: lb://orders-service
          predicates:
            - Path=/api/orders/**
          filters:
            - TokenRelay
            - name: RequestRateLimiter
              args: { redis-rate-limiter.replenishRate: 10, redis-rate-limiter.burstCapacity: 20 }

The common mistake

Watch for

Putting business logic in gateway filters. The gateway should route and protect; once it transforms payloads and makes decisions, it becomes a service everyone depends on and nobody owns.

What to know first

Your roadmap puts these before Spring Cloud Gateway, unless you already know them.

How it stays learned

Once a session shows you understand Spring Cloud Gateway, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.

  1. Day 3First recall, while it is fresh
  2. Day 7Second, a week on
  3. Day 18Last, when it has settled
Previous in the module← Service boundaries
Next in the moduleService discovery →