You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for all your hard work. Am trying to include your work and realized we must have requestLimitRules in hand before we create RedisSlidingWindowRequestRateLimiter instance. I would like to create vanilla RedisSlidingWindowRequestRateLimiter instance during application startup and inject different rules at different point in the process.
So I was looking at your code and thinking whether we can create vanilla/generic RedisSlidingWindowRequestRateLimiter without tying to limit rules and expose public method to pass in serialized rules later when needed?
Something like public RedisSlidingWindowRequestRateLimiter(StatefulRedisConnection<String, String> connection)
Highly appreciate your thoughts on my approach.
The text was updated successfully, but these errors were encountered:
You should be able to use RedisRateLimiterFactory for this purpose. I have used RedisRateLimiterFactory in the dropwizard module to dynamically create instances of RedisSlidingWindowRequestRateLimiter. While RedisRateLimiterFactory is fairly lightweight to construct the RedisRateLimiterFactory has a small internal cache of instances should this be a concern.
Looking at the implementation, I guess thats what I was looking for. It would be nice to document these use cases somewhere for future reference. Thanks @mokies!
Thank you for all your hard work. Am trying to include your work and realized we must have requestLimitRules in hand before we create RedisSlidingWindowRequestRateLimiter instance. I would like to create vanilla RedisSlidingWindowRequestRateLimiter instance during application startup and inject different rules at different point in the process.
So I was looking at your code and thinking whether we can create vanilla/generic RedisSlidingWindowRequestRateLimiter without tying to limit rules and expose public method to pass in serialized rules later when needed?
Something like
public RedisSlidingWindowRequestRateLimiter(StatefulRedisConnection<String, String> connection)
Highly appreciate your thoughts on my approach.
The text was updated successfully, but these errors were encountered: