Spring cloud SpringCloudGatewayRedis速率限制器示例

Spring cloud SpringCloudGatewayRedis速率限制器示例,spring-cloud,spring-cloud-gateway,Spring Cloud,Spring Cloud Gateway,我有一个用例,在这个用例中,我必须通过消息中的一个字段预过滤soap请求,并在该路由中添加一个基于IP的速率限制器。我正在使用SpringCloudGateway 2.0.0.RC2。 我使用readBody()方法预过滤soap请求,但我不知道如何在此路由中添加速率限制 @豆子 公共路由器连接器wsRouteLocator(路由器连接器生成器,RequestRateLimiterGatewayFilterFactory rl){ returnbuilder.routes() .route(r

我有一个用例,在这个用例中,我必须通过消息中的一个字段预过滤soap请求,并在该路由中添加一个基于IP的速率限制器。我正在使用SpringCloudGateway 2.0.0.RC2。
我使用readBody()方法预过滤soap请求,但我不知道如何在此路由中添加速率限制

@豆子
公共路由器连接器wsRouteLocator(路由器连接器生成器,RequestRateLimiterGatewayFilterFactory rl){
returnbuilder.routes()
.route(r->r.path(“/services/**”)
.及()
.readBody(String.class,s->{
试一试{
//验证xml消息
}捕获(XPathExpressionException e){
e、 printStackTrace();
返回false;
}
})
.uri(“http://10.60.96.56:9444")
)
.build();

我找到了一个使用SpringCloud 2.0.0.M4的方法。不幸的是,我在Gateway 2.0.0.M4中找不到readBody()方法。 有人能给我示范一下如何在SpringCloudGateway中使用RateLimiter吗?

检查