Interface RetryRegistry
-
- All Superinterfaces:
io.github.resilience4j.core.Registry<Retry,RetryConfig>
- All Known Implementing Classes:
InMemoryRetryRegistry
public interface RetryRegistry extends io.github.resilience4j.core.Registry<Retry,RetryConfig>
TheRetryRegistryis a factory to create Retry instances which stores all Retry instances in a registry.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classRetryRegistry.Builder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static RetryRegistry.Buildercustom()Returns a builder to create a custom RetryRegistry.io.vavr.collection.Seq<Retry>getAllRetries()Returns all managedRetryinstances.static RetryRegistryof(RetryConfig retryConfig)Creates a RetryRegistry with a custom default Retry configuration.static RetryRegistryof(RetryConfig retryConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer)Creates a RetryRegistry with a custom default Retry configuration and a Retry registry event consumer.static RetryRegistryof(RetryConfig retryConfig, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers)Creates a RetryRegistry with a custom default Retry configuration and a list of Retry registry event consumers.static RetryRegistryof(java.util.Map<java.lang.String,RetryConfig> configs)Creates a RetryRegistry with a Map of shared Retry configurations.static RetryRegistryof(java.util.Map<java.lang.String,RetryConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer)Creates a RetryRegistry with a Map of shared Retry configurations and a Retry registry event consumer.static RetryRegistryof(java.util.Map<java.lang.String,RetryConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Creates a RetryRegistry with a Map of shared Retry configurations and a Retry registry event consumer.static RetryRegistryof(java.util.Map<java.lang.String,RetryConfig> configs, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Creates a RetryRegistry with a Map of shared Retry configurations.static RetryRegistryof(java.util.Map<java.lang.String,RetryConfig> configs, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers)Creates a RetryRegistry with a Map of shared Retry configurations and a list of Retry registry event consumers.static RetryRegistryofDefaults()Creates a RetryRegistry with a default Retry configuration.Retryretry(java.lang.String name)Returns a managedRetryor creates a new one with the default Retry configuration.Retryretry(java.lang.String name, RetryConfig config)Returns a managedRetryor creates a new one with a custom Retry configuration.Retryretry(java.lang.String name, RetryConfig config, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Returns a managedRetryor creates a new one with a custom Retry configuration.Retryretry(java.lang.String name, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Returns a managedRetryor creates a new one with the default Retry configuration.Retryretry(java.lang.String name, java.lang.String configName)Returns a managedRetryor creates a new one.Retryretry(java.lang.String name, java.lang.String configName, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Returns a managedRetryor creates a new one.Retryretry(java.lang.String name, java.util.function.Supplier<RetryConfig> retryConfigSupplier)Returns a managedRetryor creates a new one with a custom Retry configuration.Retryretry(java.lang.String name, java.util.function.Supplier<RetryConfig> retryConfigSupplier, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Returns a managedRetryor creates a new one with a custom Retry configuration.
-
-
-
Method Detail
-
of
static RetryRegistry of(RetryConfig retryConfig)
Creates a RetryRegistry with a custom default Retry configuration.- Parameters:
retryConfig- a custom Retry configuration- Returns:
- a RetryRegistry with a custom Retry configuration.
-
of
static RetryRegistry of(RetryConfig retryConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer)
Creates a RetryRegistry with a custom default Retry configuration and a Retry registry event consumer.- Parameters:
retryConfig- a custom default Retry configuration.registryEventConsumer- a Retry registry event consumer.- Returns:
- a RetryRegistry with a custom Retry configuration and a Retry registry event consumer.
-
of
static RetryRegistry of(RetryConfig retryConfig, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers)
Creates a RetryRegistry with a custom default Retry configuration and a list of Retry registry event consumers.- Parameters:
retryConfig- a custom default Retry configuration.registryEventConsumers- a list of Retry registry event consumers.- Returns:
- a RetryRegistry with a custom Retry configuration and list of Retry registry event consumers.
-
ofDefaults
static RetryRegistry ofDefaults()
Creates a RetryRegistry with a default Retry configuration.- Returns:
- a RetryRegistry with a default Retry configuration.
-
of
static RetryRegistry of(java.util.Map<java.lang.String,RetryConfig> configs)
Creates a RetryRegistry with a Map of shared Retry configurations.- Parameters:
configs- a Map of shared Retry configurations- Returns:
- a RetryRegistry with a Map of shared Retry configurations.
-
of
static RetryRegistry of(java.util.Map<java.lang.String,RetryConfig> configs, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Creates a RetryRegistry with a Map of shared Retry configurations.Tags added to the registry will be added to every instance created by this registry.
- Parameters:
configs- a Map of shared Retry configurationstags- default tags to add to the registry- Returns:
- a RetryRegistry with a Map of shared Retry configurations.
-
of
static RetryRegistry of(java.util.Map<java.lang.String,RetryConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer)
Creates a RetryRegistry with a Map of shared Retry configurations and a Retry registry event consumer.- Parameters:
configs- a Map of shared Retry configurations.registryEventConsumer- a Retry registry event consumer.- Returns:
- a RetryRegistry with a Map of shared Retry configurations and a Retry registry event consumer.
-
of
static RetryRegistry of(java.util.Map<java.lang.String,RetryConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Creates a RetryRegistry with a Map of shared Retry configurations and a Retry registry event consumer.- Parameters:
configs- a Map of shared Retry configurations.registryEventConsumer- a Retry registry event consumer.tags- default tags to add to the registry- Returns:
- a RetryRegistry with a Map of shared Retry configurations and a Retry registry event consumer.
-
of
static RetryRegistry of(java.util.Map<java.lang.String,RetryConfig> configs, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers)
Creates a RetryRegistry with a Map of shared Retry configurations and a list of Retry registry event consumers.- Parameters:
configs- a Map of shared Retry configurations.registryEventConsumers- a list of Retry registry event consumers.- Returns:
- a RetryRegistry with a Map of shared Retry configurations and a list of Retry registry event consumers.
-
getAllRetries
io.vavr.collection.Seq<Retry> getAllRetries()
Returns all managedRetryinstances.- Returns:
- all managed
Retryinstances.
-
retry
Retry retry(java.lang.String name)
Returns a managedRetryor creates a new one with the default Retry configuration.- Parameters:
name- the name of the Retry- Returns:
- The
Retry
-
retry
Retry retry(java.lang.String name, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Returns a managedRetryor creates a new one with the default Retry configuration.The
tagspassed 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 Retrytags- tags added to the Retry- Returns:
- The
Retry
-
retry
Retry retry(java.lang.String name, RetryConfig config)
Returns a managedRetryor creates a new one with a custom Retry configuration.- Parameters:
name- the name of the Retryconfig- a custom Retry configuration- Returns:
- The
Retry
-
retry
Retry retry(java.lang.String name, RetryConfig config, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Returns a managedRetryor creates a new one with a custom Retry configuration.The
tagspassed 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 Retryconfig- a custom Retry configurationtags- tags added to the Retry- Returns:
- The
Retry
-
retry
Retry retry(java.lang.String name, java.util.function.Supplier<RetryConfig> retryConfigSupplier)
Returns a managedRetryor creates a new one with a custom Retry configuration.- Parameters:
name- the name of the RetryretryConfigSupplier- a supplier of a custom Retry configuration- Returns:
- The
Retry
-
retry
Retry retry(java.lang.String name, java.util.function.Supplier<RetryConfig> retryConfigSupplier, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Returns a managedRetryor creates a new one with a custom Retry configuration.The
tagspassed 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 RetryretryConfigSupplier- a supplier of a custom Retry configurationtags- tags added to the Retry- Returns:
- The
Retry
-
retry
Retry retry(java.lang.String name, java.lang.String configName)
Returns a managedRetryor creates a new one. The configuration must have been added upfront viaRegistry.addConfiguration(String, Object).- Parameters:
name- the name of the RetryconfigName- the name of the shared configuration- Returns:
- The
Retry
-
retry
Retry retry(java.lang.String name, java.lang.String configName, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Returns a managedRetryor creates a new one. The configuration must have been added upfront viaRegistry.addConfiguration(String, Object).The
tagspassed 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 RetryconfigName- the name of the shared configurationtags- tags added to the Retry- Returns:
- The
Retry
-
custom
static RetryRegistry.Builder custom()
Returns a builder to create a custom RetryRegistry.- Returns:
- a
RetryRegistry.Builder
-
-