Closed ethan810818 closed 3 months ago
rateLimiter easily fetches auth if auth is the only configuration. But when there are many specific configurations (merchant, page), how will rateLimiter handle them?
Any answer is helpful to me. Thank you for viewing this post
Hi @bmt810818!
You can inject the ApplicationContext
Bean in your factory methods and call setApplicationContext
on the RedisRateLimiter
instance. This way the redisRateLimiter will be initialized.
Hope this helps
Describe the bug: I get an error when I try to manually configure the RedisRateLimiter and include it in setRateLimiter() ERROR: java.lang.IllegalStateException: RedisRateLimiter is not initialized
I used a fire-fighting solution called rateLimiter and it worked. However, that caused another problem:
CODE: https://github.com/bmt810818/spring-cloud-gateway
version: spring-cloud-gateway-server-4.0.7.jar:4.0.7
dependencies: implementation 'org.springframework.boot:spring-boot-starter-data-redis'