阅读文本大概需要3分钟。
Spring Cloud Gateway是由spring官方基于Spring5.0、Spring Boot2.x、Project Reactor 等技术开发的 网关,目的是代替原先版本中的Spring Cloud Netfilx Zuul。
0x01: Gateway网关特性
0x02: 断言(Predicates)
官方参考地址https://cloud.spring.io/spring-cloud-gateway/reference/html/#_after_route_predicate_factory
0x03: 过滤器(Filter)
路由过滤器允许以某种方式修改传入的HTTP请求或传出的HTTP响应。路径过滤器的范围限定为特定路径。Spring Cloud Gateway包含许多内置的GatewayFilter工厂。
0x04: GlobalFilter 全局过滤器
0x05: CORS跨域处理
例子:对于所有GET请求的路径,将允许来自docs.spring.io的请求的CORS请求。
Gateway API
/actuator/gateway/refresh POST
查询指定路由信息