HomeGuidesChangelog
GuidesGitHubLog In
Guides

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);