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>
The RetryRegistry is a factory to create Retry instances which stores all Retry instances in a registry.
  • Method Details

    • 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, 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(Map<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(Map<String,RetryConfig> configs, Map<String,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 configurations
      tags - default tags to add to the registry
      Returns:
      a RetryRegistry with a Map of shared Retry configurations.
    • of

      static RetryRegistry of(Map<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(Map<String,RetryConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer, Map<String,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(Map<String,RetryConfig> configs, 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

      Set<Retry> getAllRetries()
      Returns all managed Retry instances.
      Returns:
      all managed Retry instances.
    • retry

      Retry retry(String name)
      Returns a managed Retry or creates a new one with the default Retry configuration.
      Parameters:
      name - the name of the Retry
      Returns:
      The Retry
    • retry

      Retry retry(String name, Map<String,String> tags)
      Returns a managed Retry or creates a new one with the default Retry 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 Retry
      tags - tags added to the Retry
      Returns:
      The Retry
    • retry

      Retry retry(String name, RetryConfig config)
      Returns a managed Retry or creates a new one with a custom Retry configuration.
      Parameters:
      name - the name of the Retry
      config - a custom Retry configuration
      Returns:
      The Retry
    • retry

      Retry retry(String name, RetryConfig config, Map<String,String> tags)
      Returns a managed Retry or creates a new one with a custom Retry 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 Retry
      config - a custom Retry configuration
      tags - tags added to the Retry
      Returns:
      The Retry
    • retry

      Retry retry(String name, Supplier<RetryConfig> retryConfigSupplier)
      Returns a managed Retry or creates a new one with a custom Retry configuration.
      Parameters:
      name - the name of the Retry
      retryConfigSupplier - a supplier of a custom Retry configuration
      Returns:
      The Retry
    • retry

      Retry retry(String name, Supplier<RetryConfig> retryConfigSupplier, Map<String,String> tags)
      Returns a managed Retry or creates a new one with a custom Retry 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 Retry
      retryConfigSupplier - a supplier of a custom Retry configuration
      tags - tags added to the Retry
      Returns:
      The Retry
    • retry

      Retry retry(String name, String configName)
      Returns a managed Retry or creates a new one. The configuration must have been added upfront via Registry.addConfiguration(String, Object).
      Parameters:
      name - the name of the Retry
      configName - the name of the shared configuration
      Returns:
      The Retry
    • retry

      Retry retry(String name, String configName, Map<String,String> tags)
      Returns a managed Retry or creates a new one. The configuration must have been added upfront via Registry.addConfiguration(String, Object).

      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 Retry
      configName - the name of the shared configuration
      tags - 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