Spring Cloud Gateway将路由作为Spring WebFlux HandlerMapping基础结构的一部分进行匹配。Spring Cloud Gateway包含许多内置的Route Predicate工厂。所有这些谓词都匹配HTTP请求的不同属性。多路线谓词工厂可以组合并通过逻辑组合and。
after
After Route谓词工厂采用一个参数,一个日期时间。此谓词匹配在当前日期时间之后发生的请求。

Before Route Predicate Factory采用一个参数,一个日期时间。此谓词匹配在当前日期时间之前发生的请求。
before

Between Route Predicate Factory有两个参数,datetime1和datetime2。此谓词匹配datetime1之后和datetime2之前发生的请求。datetime2参数必须在datetime1之后。
between

网友评论