Spring Cloud Gateway provides a library for building an API Gateway on top of Spring MVC. 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.
开始
1 |
|
基于Java流式API自定义RouteLocator的方式定义路由信息
1 |
|
通过配置的方式
1 |
|
开启端点,提供了关于Filter及routes的信息查询以及指定route信息更新的Rest API接口
1 |
|
http://localhost:8080/actuator/gateway/routes
1 |
|
http://localhost:8081/actuator/gateway/routes
1 |
|
路由断言工厂(Route Predicte Factory)
接口:RoutePredicateFactory
Path
After
Before
Between
Cookie
Header
Host
Method
Query
RemoteAddr
Weight
权重
过滤器
Global Filter
接口:GlobalFilter
Gateway Filter
GatewayFilter
过滤器工厂(Gateway Filter Factory)
接口:GatewayFilterFactory