spring-cloud-starter-gateway 限流无效

问题遇到的现象和发生背景

写了一个网关,路由功能正常,但是限流功能一直不生效,引入的spring-cloud-starter-gateway版本也从2.2.1换到2.2.9,但是限流始终不生效,不知道有没有大lao能帮忙看一下,下面贴上代码

问题相关代码,请勿粘贴截图

引入的依赖:

         <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis-reactive</artifactId>
        </dependency>

        <!--gateway-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-gateway</artifactId>
            <version>2.2.3.RELEASE</version>
        </dependency>
spring:
  cloud:
    gateway:
      # 路由集合
      routes:
        #payment_route路由的ID,没有固定规则但要求唯一,建议配合服务名
        - id: powerrecord-server
          #匹配后提供服务的路由地址
          uri: lb://powerrecord
          # 断言,路径相匹配的进行路由
          predicates: 
            - Path=/server/**
            #- After=2020-02-21T15:51:37.485+08:00[Asia/Shanghai]
            #- Cookie=username,zzyy
            #- Header=X-Request-Id, \d+  # 请求头要有X-Request-Id属性并且值为整数的正则表达式
          filters:
            - name: RequestRateLimiter
              args:
                # 令牌桶每秒填充平均速率
                redis-rate-limiter.replenishRate: 1
                # 令牌桶的上限
                redis-rate-limiter.burstCapacity: 1
                # 使用SpEL表达式从Spring容器中获取Bean对象
                key-resolver: '#{@ipKeyResolver}'
  redis:
    host: xx.xx.xx.xx
    port: 6388
    password: ENC(+I5Y1D9DQ1kXC+9yg8QQdga8vV4QGLsTiVxtiizoXapzMHu9L42OcTkE6v3x6BAP)
@Configuration
public class LimitConfiguration {

    /**
     * 按ip限流
     */
    @Bean(value = "ipKeyResolver")
    public KeyResolver ipKeyResolver() {
        System.out.println("##############ipKeyResolver########################");
        return exchange -> Mono.just(exchange.getRequest().getRemoteAddress().getHostName());
    }
}

@SpringBootApplication
@EnableDiscoveryClient
public class PRGatewayApplication {
    public static void main(String[] args) {
        System.setProperty("jasypt.encryptor.password", ConstantsInterface.JASYPT_ENCRYPTOR_PASSWORD);
        SpringApplication.run(PRGatewayApplication.class, args);
    }
}

运行结果及报错内容

无报错,连续点击发送请求,限流不生效

我的解答思路和尝试过的方法

更换spring-cloud-starter-gateway版本,使用其他自定义限流方式,目前用过的方法都无效

我想要达到的结果

可以正常起到限流作用

你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。


因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。