RateLimiter is not working
See original GitHub issueApart from redis connection, do we have to do anything else for a basic rate limiter to work? As I’ve been trying to create a rate limiter but it is not working as it is supposed to.
Rate limiter :
RedisRateLimiter redisRateLimiter() { return new RedisRateLimiter(1, 2); }
Portion of my route:
.route("redis_rate_check", r->r.path("/redisrate") .and().method(HttpMethod.GET) .filters(f -> f.requestRateLimiter(rate -> rate .setRateLimiter(redisRateLimiter())) ) .uri("http://localhost:9081/rate"))
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Laravel 8 rate limiter not working for routes - Stack Overflow
Since Laravel 8 you can configure rate limits in the method configureRateLimiting() of the App\Providers\RouteServiceProvider . For example:
Read more >Rate limiter is not working (at least in test) - Laracasts
I've defined a rate limiter to throttle the number of requests a user can send each time and now I'm trying to test...
Read more >RateLimiter not working with Spring · Issue #1315 - GitHub
I have a project where the goal is to read records from a database, manipulate those records, and then insert them into another...
Read more >RateLimiter with 1 permitsPerSecond does not appear to work ...
My use case is that I create the single RateLimiter instance in a static context and that instance is passed to all callers...
Read more >RateLimiter (Guava: Google Core Libraries for Java 19.0 API)
The returned RateLimiter ensures that on average no more than permitsPerSecond are issued during any given second, with sustained requests being smoothly spread ......
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
@jayendra155 never tested using code configuration, but I guess you need a KeyResolver somewhere. I think the default one limits based on the Principal authentified. Maybe that is your problem.
@stevenNzonzi Rate limiter configuration doesnt work using shortcut form (see #167 ). Here is 2 working configuration:
Using a rate limiter bean:
Hardcoding the configuration:
I would like to know that too, whenever I use the rate limiter, my test endpoint returns a blank body with a 200 ok. This is the bean that I created, nothing special,
And this is my config file,
This is the log I get in DEBUG mode