Adds key-resolver example to requestratelimiter-factory.adoc

Fixes gh-2733

Co-authored-by: Archimedes Trajano <developer@trajano.net>
This commit is contained in:
sgibb
2024-03-08 15:56:13 -05:00
parent f6182dfa03
commit 688391a008

View File

@@ -32,10 +32,28 @@ You can adjust this behavior by setting the `spring.cloud.gateway.filter.request
The `RequestRateLimiter` is not configurable with the "shortcut" notation. The following example below is _invalid_:
.application.properties
[source,properties]
----
# INVALID SHORTCUT CONFIGURATION
spring.cloud.gateway.routes[0].filters[0]=RequestRateLimiter=2, 2, #{@userkeyresolver}
----
Here is a valid yaml reference:
.application.yml
[source,yaml]
----
spring:
cloud:
gateway:
routes:
- id: limit
uri: https://example.org
filters:
- name: RequestRateLimiter
args:
key-resolver: "#{@userkeyresolver}"
----
=====
[[redis-ratelimiter]]