Routing and filters
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
configure Spring Cloud Gateway routes and filters.
Planned topics
- A route has an id, a destination URI, predicates (match path, method, header) and filters (change the request or response).
- Common filters: strip a path prefix, add headers, rewrite paths, rate limit, retry.
- Destination URIs use service names from DNS (
http://orders:8080), not hard-coded IPs. - Gateway is reactive (WebFlux); never block in a filter.
- Verify the starter name and property keys for your Spring Cloud version before recording.
Draft outline details
Demonstration
spring:
cloud:
gateway:
routes:
- id: orders
uri: http://orders:8080
predicates: [ Path=/api/orders/** ]
filters: [ StripPrefix=1 ]Check your understanding
What does a predicate do?
Show answer
Decides whether a request matches the route.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.