2. API Gateway Role & Responsibilities
● Routing
● Security
● Monitoring
● Canarying
● Resiliency
● Monolith Strangling
G
A
T
E
W
A
Y
Server Side
MVC App
Microservice A
JS or
Mobile App
Microservice B
Microservice C
3. API Gateways - Then and Now
Many API Management Gateways can be dated
back to SOA and these tend to have been
implemented as centralized servers. But as
microservices became more popular, modern
lightweight independent and decentralized
micro-gateway applications have appeared –
such as Spring Cloud Gateway.
Source: Ben Wilcock
https://spring.io/blog/2019/06/18/getting-started-with-spring-cloud-gateway
〝
〞
7. Gateway Flow
Client Predicates Pre-Filters Global Filters
Post-Filters
Downstream
Service
Gateway
Handler Mapping Web Handler
8. Gateway Flow
Client Predicates Pre-Filters Global Filters
Post-Filters
Downstream
Service
Gateway
Handler Mapping Web Handler
Predicates
● Date/Time
● Cookies
● Headers
● Host
● Method
● Path
● Query Params
● Remote Address
● Weight
9. Gateway Flow
Client Predicates Pre-Filters Global Filters
Post-Filters
Downstream
Service
Gateway
Handler Mapping Web Handler
Pre-Filters
● Headers
● Parameters
● Path
● Circuit Breaker
● Retry
● Rate Limiter
● Redirect
● Save Session
● Size
● Host
● Metrics
● Modify Body
10. Gateway Flow
Client Predicates Pre-Filters Global Filters
Post-Filters
Downstream
Service
Gateway
Handler Mapping Web Handler
Global Filters
● Netty Router
● Web Sockets
● Load Balancer
● Metrics
11. Gateway Flow
Client Predicates Pre-Filters Global Filters
Post-Filters
Downstream
Service
Gateway
Handler Mapping Web Handler
Post Filters
● Set Status
● Headers
● Modify Body
12. Routes: building blocks of a gateway
Defined by:
● ID
● Destination URI
● Collection of predicates (for matching requests to the route)
● Collection of filters (for modifying the request or response)
Specified as:
● Java
● Properties
14. TD Ameritrade @ SpringOne 2019
Poornima Rajendhran
Michael Dennis
Mounika Kikkuru
youtube.com/watch?v=TzKlxr5R-Ew&t=93s
Saravanan Paramasivam
Chris Jackson
youtube.com/watch?v=RRMO4oNptoQ