Skip to content

Commit

Permalink
Support for Method level @ratelimiting annoation #250
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcGiffing committed Mar 11, 2024
1 parent 0860e0c commit 1f7263d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class TestService {


@RateLimiting(name = "hello",
@RateLimiting(name = "default",
executeCondition = "#myParamName != 'admin'",
ratePerMethod = true,
fallbackMethodName = "dummy")
Expand Down
6 changes: 2 additions & 4 deletions examples/caffeine/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ bucket4j:
filter-config-caching-enabled: true
filter-config-cache-name: filterConfigCache
methods:
- name: hello
- name: default
cache-name: buckets
rate-limit:
cache-key: 1
execute-condition: true
post-execute-condition: "#root == 'alpha'"
bandwidths:
- capacity: 1
refill-capacity: 1
Expand All @@ -38,7 +36,7 @@ bucket4j:
filters:
- id: filter1
cache-name: buckets
url: world
url: .*
rate-limits:
- cache-key: getRemoteAddr()
post-execute-condition: getStatus() eq 200
Expand Down

0 comments on commit 1f7263d

Please sign in to comment.