Interface RateLimiterRegistry
- All Superinterfaces:
io.github.resilience4j.core.Registry<RateLimiter,
RateLimiterConfig>
- All Known Implementing Classes:
InMemoryRateLimiterRegistry
public interface RateLimiterRegistry
extends io.github.resilience4j.core.Registry<RateLimiter,RateLimiterConfig>
Manages all RateLimiter instances.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.resilience4j.core.Registry
io.github.resilience4j.core.Registry.EventPublisher<E extends Object>
-
Method Summary
Modifier and TypeMethodDescriptionstatic RateLimiterRegistry.Builder
custom()
Returns a builder to create a custom RateLimiterRegistry.Returns all managedRateLimiter
instances.static RateLimiterRegistry
of
(RateLimiterConfig defaultRateLimiterConfig) Creates a RateLimiterRegistry with a custom RateLimiter configuration.static RateLimiterRegistry
of
(RateLimiterConfig defaultRateLimiterConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter> registryEventConsumer) Creates a RateLimiterRegistry with a custom default RateLimiter configuration and a RateLimiter registry event consumer.static RateLimiterRegistry
of
(RateLimiterConfig defaultRateLimiterConfig, List<io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter>> registryEventConsumers) Creates a RateLimiterRegistry with a custom default RateLimiter configuration and a list of RateLimiter registry event consumers.static RateLimiterRegistry
of
(Map<String, RateLimiterConfig> configs) Creates a ThreadPoolBulkheadRegistry with a Map of shared RateLimiter configurations.static RateLimiterRegistry
of
(Map<String, RateLimiterConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter> registryEventConsumer) Creates a RateLimiterRegistry with a Map of shared RateLimiter configurations and a RateLimiter registry event consumer.static RateLimiterRegistry
of
(Map<String, RateLimiterConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter> registryEventConsumer, Map<String, String> tags) Creates a RateLimiterRegistry with a Map of shared RateLimiter configurations and a RateLimiter registry event consumer.static RateLimiterRegistry
of
(Map<String, RateLimiterConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter>> registryEventConsumers) Creates a RateLimiterRegistry with a Map of shared RateLimiter configurations and a list of RateLimiter registry event consumers.static RateLimiterRegistry
Creates a ThreadPoolBulkheadRegistry with a Map of shared RateLimiter configurations.static RateLimiterRegistry
Returns a managedRateLimiterConfig
or creates a new one with a default RateLimiter configuration.rateLimiter
(String name) Returns a managedRateLimiter
or creates a new one with the default RateLimiter configuration.rateLimiter
(String name, RateLimiterConfig rateLimiterConfig) Returns a managedRateLimiter
or creates a new one with a custom RateLimiter configuration.rateLimiter
(String name, RateLimiterConfig rateLimiterConfig, Map<String, String> tags) Returns a managedRateLimiter
or creates a new one with a custom RateLimiter configuration.rateLimiter
(String name, String configName) Returns a managedRateLimiter
or creates a new one.Returns a managedRateLimiter
or creates a new one.rateLimiter
(String name, Supplier<RateLimiterConfig> rateLimiterConfigSupplier) Returns a managedRateLimiterConfig
or creates a new one with a custom RateLimiterConfig configuration.rateLimiter
(String name, Supplier<RateLimiterConfig> rateLimiterConfigSupplier, Map<String, String> tags) Returns a managedRateLimiterConfig
or creates a new one with a custom RateLimiterConfig configuration.rateLimiter
(String name, Map<String, String> tags) Returns a managedRateLimiter
or creates a new one with the default RateLimiter configuration.Methods inherited from interface io.github.resilience4j.core.Registry
addConfiguration, find, getConfiguration, getDefaultConfig, getEventPublisher, getTags, remove, replace
-
Method Details
-
of
Creates a RateLimiterRegistry with a custom RateLimiter configuration.- Parameters:
defaultRateLimiterConfig
- a custom RateLimiter configuration- Returns:
- a RateLimiterRegistry instance backed by a custom RateLimiter configuration
-
of
static RateLimiterRegistry of(RateLimiterConfig defaultRateLimiterConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter> registryEventConsumer) Creates a RateLimiterRegistry with a custom default RateLimiter configuration and a RateLimiter registry event consumer.- Parameters:
defaultRateLimiterConfig
- a custom default RateLimiter configuration.registryEventConsumer
- a RateLimiter registry event consumer.- Returns:
- a RateLimiterRegistry with a custom RateLimiter configuration and a RateLimiter registry event consumer.
-
of
static RateLimiterRegistry of(RateLimiterConfig defaultRateLimiterConfig, List<io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter>> registryEventConsumers) Creates a RateLimiterRegistry with a custom default RateLimiter configuration and a list of RateLimiter registry event consumers.- Parameters:
defaultRateLimiterConfig
- a custom default RateLimiter configuration.registryEventConsumers
- a list of RateLimiter registry event consumers.- Returns:
- a RateLimiterRegistry with a custom RateLimiter configuration and a list of RateLimiter registry event consumers.
-
ofDefaults
Returns a managedRateLimiterConfig
or creates a new one with a default RateLimiter configuration.- Returns:
- The
RateLimiterConfig
-
of
Creates a ThreadPoolBulkheadRegistry with a Map of shared RateLimiter configurations.- Parameters:
configs
- a Map of shared RateLimiter configurations- Returns:
- a ThreadPoolBulkheadRegistry with a Map of shared RateLimiter configurations.
-
of
Creates a ThreadPoolBulkheadRegistry with a Map of shared RateLimiter configurations.Tags added to the registry will be added to every instance created by this registry.
- Parameters:
configs
- a Map of shared RateLimiter configurationstags
- default tags to add to the registry- Returns:
- a ThreadPoolBulkheadRegistry with a Map of shared RateLimiter configurations.
-
of
static RateLimiterRegistry of(Map<String, RateLimiterConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter> registryEventConsumer) Creates a RateLimiterRegistry with a Map of shared RateLimiter configurations and a RateLimiter registry event consumer.- Parameters:
configs
- a Map of shared RateLimiter configurations.registryEventConsumer
- a RateLimiter registry event consumer.- Returns:
- a RateLimiterRegistry with a Map of shared RateLimiter configurations and a RateLimiter registry event consumer.
-
of
static RateLimiterRegistry of(Map<String, RateLimiterConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter> registryEventConsumer, Map<String, String> tags) Creates a RateLimiterRegistry with a Map of shared RateLimiter configurations and a RateLimiter registry event consumer.- Parameters:
configs
- a Map of shared RateLimiter configurations.registryEventConsumer
- a RateLimiter registry event consumer.tags
- default tags to add to the registry- Returns:
- a RateLimiterRegistry with a Map of shared RateLimiter configurations and a RateLimiter registry event consumer.
-
of
static RateLimiterRegistry of(Map<String, RateLimiterConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter>> registryEventConsumers) Creates a RateLimiterRegistry with a Map of shared RateLimiter configurations and a list of RateLimiter registry event consumers.- Parameters:
configs
- a Map of shared RateLimiter configurations.registryEventConsumers
- a list of RateLimiter registry event consumers.- Returns:
- a RateLimiterRegistry with a Map of shared RateLimiter configurations and a list of RateLimiter registry event consumers.
-
getAllRateLimiters
Set<RateLimiter> getAllRateLimiters()Returns all managedRateLimiter
instances.- Returns:
- all managed
RateLimiter
instances.
-
rateLimiter
Returns a managedRateLimiter
or creates a new one with the default RateLimiter configuration.- Parameters:
name
- the name of the RateLimiter- Returns:
- The
RateLimiter
-
rateLimiter
Returns a managedRateLimiter
or creates a new one with the default RateLimiter configuration.The
tags
passed will be appended to the tags already configured for the registry. When tags (keys) of the two collide the tags passed with this method will override the tags of the registry.- Parameters:
name
- the name of the RateLimitertags
- tags added to the RateLimiter- Returns:
- The
RateLimiter
-
rateLimiter
Returns a managedRateLimiter
or creates a new one with a custom RateLimiter configuration.- Parameters:
name
- the name of the RateLimiterrateLimiterConfig
- a custom RateLimiter configuration- Returns:
- The
RateLimiter
-
rateLimiter
Returns a managedRateLimiter
or creates a new one with a custom RateLimiter configuration.The
tags
passed will be appended to the tags already configured for the registry. When tags (keys) of the two collide the tags passed with this method will override the tags of the registry.- Parameters:
name
- the name of the RateLimiterrateLimiterConfig
- a custom RateLimiter configurationtags
- tags added to the RateLimiter- Returns:
- The
RateLimiter
-
rateLimiter
Returns a managedRateLimiterConfig
or creates a new one with a custom RateLimiterConfig configuration.- Parameters:
name
- the name of the RateLimiterConfigrateLimiterConfigSupplier
- a supplier of a custom RateLimiterConfig configuration- Returns:
- The
RateLimiterConfig
-
rateLimiter
RateLimiter rateLimiter(String name, Supplier<RateLimiterConfig> rateLimiterConfigSupplier, Map<String, String> tags) Returns a managedRateLimiterConfig
or creates a new one with a custom RateLimiterConfig configuration.The
tags
passed will be appended to the tags already configured for the registry. When tags (keys) of the two collide the tags passed with this method will override the tags of the registry.- Parameters:
name
- the name of the RateLimiterConfigrateLimiterConfigSupplier
- a supplier of a custom RateLimiterConfig configurationtags
- tags added to the RateLimiter- Returns:
- The
RateLimiterConfig
-
rateLimiter
Returns a managedRateLimiter
or creates a new one. The configuration must have been added upfront viaRegistry.addConfiguration(String, Object)
.- Parameters:
name
- the name of the RateLimiterconfigName
- the name of the shared configuration- Returns:
- The
RateLimiter
-
rateLimiter
Returns a managedRateLimiter
or creates a new one. The configuration must have been added upfront viaRegistry.addConfiguration(String, Object)
.- Parameters:
name
- the name of the RateLimiterconfigName
- the name of the shared configuration- Returns:
- The
RateLimiter
-
custom
Returns a builder to create a custom RateLimiterRegistry.- Returns:
- a
RateLimiterRegistry.Builder
-