Class RequestRateLimiterGatewayFilterFactory
java.lang.Object
org.springframework.cloud.gateway.support.AbstractConfigurable<RequestRateLimiterGatewayFilterFactory.Config>
org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory<RequestRateLimiterGatewayFilterFactory.Config>
org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory
- All Implemented Interfaces:
org.springframework.beans.factory.Aware, GatewayFilterFactory<RequestRateLimiterGatewayFilterFactory.Config>, Configurable<RequestRateLimiterGatewayFilterFactory.Config>, ShortcutConfigurable, org.springframework.context.ApplicationEventPublisherAware
@ConfigurationProperties("spring.cloud.gateway.server.webflux.filter.request-rate-limiter")
public class RequestRateLimiterGatewayFilterFactory
extends AbstractGatewayFilterFactory<RequestRateLimiterGatewayFilterFactory.Config>
User Request Rate Limiter filter. See https://stripe.com/blog/rate-limiters and
https://gist.github.com/ptarjan/e38f45f2dfe601419ca3af937fff574d#file-1-check_request_rate_limiter-rb-L11-L34.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class AbstractGatewayFilterFactory
AbstractGatewayFilterFactory.NameConfigNested classes/interfaces inherited from interface ShortcutConfigurable
ShortcutConfigurable.GatewayBeanFactoryResolver, ShortcutConfigurable.GatewayEvaluationContext, ShortcutConfigurable.RestrictivePropertyAccessor, ShortcutConfigurable.ShortcutType -
Field Summary
FieldsFields inherited from interface GatewayFilterFactory
NAME_KEY, VALUE_KEY -
Constructor Summary
ConstructorsConstructorDescriptionRequestRateLimiterGatewayFilterFactory(RateLimiter defaultRateLimiter, KeyResolver defaultKeyResolver) -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidsetDenyEmptyKey(boolean denyEmptyKey) voidsetEmptyKeyStatusCode(String emptyKeyStatusCode) Methods inherited from class AbstractGatewayFilterFactory
enableBodyCaching, getPublisher, setApplicationEventPublisherMethods inherited from class AbstractConfigurable
getConfigClass, newConfig, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface GatewayFilterFactory
apply, apply, apply, getConfigClass, name, newConfigMethods inherited from interface ShortcutConfigurable
shortcutFieldOrder, shortcutFieldPrefix, shortcutType
-
Field Details
-
KEY_RESOLVER_KEY
-
-
Constructor Details
-
RequestRateLimiterGatewayFilterFactory
public RequestRateLimiterGatewayFilterFactory(RateLimiter defaultRateLimiter, KeyResolver defaultKeyResolver)
-
-
Method Details
-
getDefaultKeyResolver
-
getDefaultRateLimiter
-
isDenyEmptyKey
public boolean isDenyEmptyKey() -
setDenyEmptyKey
public void setDenyEmptyKey(boolean denyEmptyKey) -
getEmptyKeyStatusCode
-
setEmptyKeyStatusCode
-
apply
-