RRateLimiter does not provide way to overwrite config
See original GitHub issueExpected behavior
RRateLimiter
does not have a setRate
/setRateAsync
method.
It only has trySetRate
/trySetRateAsync
methods, so once a rate-limiter’s config is persisted to Redis, it cannot be overwritten.
Actual behavior
Invoking RRateLimiter.trySetRate
twice with different rate-limiter configuration values does not overwrite, since it uses HSETNX
instead of HSET
operation.
Steps to reproduce or test case
RRateLimiter rateLimiter = redisson.getRateLimiter("myRateLimiter");
boolean success;
success = rateLimiter.trySetRate(RateType.OVERALL, 1, 1, RateIntervalUnit.SECONDS);
System.out.println(success); // "true"
success = rateLimiter.trySetRate(RateType.OVERALL, 2, 2, RateIntervalUnit.SECONDS);
System.out.println(success); // "false"
There is no way to overwrite the existing "myRateLimiter"
with a different rate, besides modifying the rate limiter name
Redis version
4.0.11
Redisson version
3.11.2
Redisson configuration
N/A
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:10 (4 by maintainers)
Top Results From Across the Web
RRateLimiter (Redisson 3.11.6 API) - javadoc.io
Returns current configuration of this RateLimiter object. ... If no permit is available then this method will return immediately with the value false...
Read more >Improving Concurrency in Redis Rate Limiting System - Rockset
We use a rate limiting system, based on Redis, to protect services from overload. Learn how we increased its concurrency and scalability in ......
Read more >org.redisson.api.RRateLimiter Java Examples
The following examples show how to use org.redisson.api.RRateLimiter ... RedissonClient client = Redisson.create(config); RRateLimiter rateLimiter = client.
Read more >CHANGELOG.md · master · edNb8H / Redisson · GitCode
breaking change - spring.redis.redisson.config setting renamed to ... Fixed - RRateLimiter.delete() method doesn't delete all allocated Redis objects
Read more >P-GW Administration Guide, StarOS Release 21.22 - Cisco
The UE Overload Protection feature provides a mechanism to monitor ... Otherwise, the values are not programmed in the fast path, instead, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Merged
@mrniko that is what I ended up doing, using an
RMap
object w/ the same name as myRRateLimiter
.I (and @kmartin I think) were expecting a less janky way to do this, using methods exposed via the
RRateLimiter
interface