Examples
Examples of resilience4j-ratelimiter
Create a RateLimiterRegistry
Create a RateLimiterRegistry with a custom RateLimiterConfig.
// Create a custom configuration for a RateLimiter
RateLimiterConfig config = RateLimiterConfig.custom()
.timeoutDuration(TIMEOUT)
.limitRefreshPeriod(REFRESH_PERIOD)
.limitForPeriod(LIMIT)
.build();
// Create a RateLimiterRegistry with a custom global configuration
RateLimiterRegistry registry = RateLimiterRegistry.of(config);
Updated over 5 years ago