Class SpringCloudGatewayRateLimitFilter

java.lang.Object
com.giffing.bucket4j.spring.boot.starter.filter.reactive.gateway.SpringCloudGatewayRateLimitFilter
All Implemented Interfaces:
org.springframework.cloud.gateway.filter.GlobalFilter, org.springframework.core.Ordered

public class SpringCloudGatewayRateLimitFilter
extends Object
implements org.springframework.cloud.gateway.filter.GlobalFilter, org.springframework.core.Ordered
GlobalFilter to configure Bucket4j on each request.
  • Field Summary

    Fields inherited from interface org.springframework.core.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Constructor Summary

    Constructors
    Constructor Description
    SpringCloudGatewayRateLimitFilter​(FilterConfiguration<org.springframework.http.server.reactive.ServerHttpRequest> filterConfig)  
  • Method Summary

    Modifier and Type Method Description
    reactor.core.publisher.Mono<Void> filter​(org.springframework.web.server.ServerWebExchange exchange, org.springframework.cloud.gateway.filter.GatewayFilterChain chain)  
    int getOrder()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpringCloudGatewayRateLimitFilter

      public SpringCloudGatewayRateLimitFilter​(FilterConfiguration<org.springframework.http.server.reactive.ServerHttpRequest> filterConfig)
  • Method Details

    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • filter

      public reactor.core.publisher.Mono<Void> filter​(org.springframework.web.server.ServerWebExchange exchange, org.springframework.cloud.gateway.filter.GatewayFilterChain chain)
      Specified by:
      filter in interface org.springframework.cloud.gateway.filter.GlobalFilter