java.lang.Object
org.miaixz.bus.vortex.filter.AbstractFilter
org.miaixz.bus.vortex.filter.LimitFilter
- All Implemented Interfaces:
Filter,org.springframework.web.server.WebFilter
限流过滤器,基于令牌桶算法对请求进行流量限制
- Since:
- Java 17+
- Author:
- Justubborn
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.miaixz.bus.vortex.filter.AbstractFilter
checkParams, filter, getAssets, getContext, getRequestMap, setContentType
-
Constructor Details
-
LimitFilter
构造器,初始化限流注册表- Parameters:
registry- 限流注册表
-
-
Method Details
-
doFilter
protected reactor.core.publisher.Mono<Void> doFilter(org.springframework.web.server.ServerWebExchange exchange, org.springframework.web.server.WebFilterChain chain, Context context) 内部过滤方法,执行限流逻辑- Specified by:
doFilterin classAbstractFilter- Parameters:
exchange- 当前的 ServerWebExchange 对象chain- 过滤器链context- 请求上下文- Returns:
reactor.core.publisher.Mono<Void>表示异步处理完成
-