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
-
Constructor Details
-
SpringCloudGatewayRateLimitFilter
public SpringCloudGatewayRateLimitFilter(FilterConfiguration<org.springframework.http.server.reactive.ServerHttpRequest> filterConfig)
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.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:
filterin interfaceorg.springframework.cloud.gateway.filter.GlobalFilter
-