Class InMemoryRetryRegistry

java.lang.Object
io.github.resilience4j.core.registry.AbstractRegistry<Retry,RetryConfig>
io.github.resilience4j.retry.internal.InMemoryRetryRegistry
All Implemented Interfaces:
io.github.resilience4j.core.Registry<Retry,RetryConfig>, RetryRegistry

public final class InMemoryRetryRegistry extends io.github.resilience4j.core.registry.AbstractRegistry<Retry,RetryConfig> implements RetryRegistry
Backend retry manager. Constructs backend retries according to configuration values.
  • Constructor Details

    • InMemoryRetryRegistry

      public InMemoryRetryRegistry()
      The constructor with default default.
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(Map<String,RetryConfig> configs)
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(Map<String,RetryConfig> configs, Map<String,String> tags)
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(Map<String,RetryConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer)
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(Map<String,RetryConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer, Map<String,String> tags)
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(Map<String,RetryConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers)
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(Map<String,RetryConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers, Map<String,String> tags)
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(Map<String,RetryConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers, Map<String,String> tags, io.github.resilience4j.core.RegistryStore<Retry> registryStore)
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(RetryConfig defaultConfig)
      The constructor with custom default config.
      Parameters:
      defaultConfig - The default config.
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(RetryConfig defaultConfig, Map<String,String> tags)
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(RetryConfig defaultConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer)
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(RetryConfig defaultConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer, Map<String,String> tags)
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(RetryConfig defaultConfig, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers)
    • InMemoryRetryRegistry

      public InMemoryRetryRegistry(RetryConfig defaultConfig, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers, Map<String,String> tags)
  • Method Details

    • getAllRetries

      public Set<Retry> getAllRetries()
      Returns all managed Retry instances.
      Specified by:
      getAllRetries in interface RetryRegistry
      Returns:
      all managed Retry instances.
    • retry

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

      public 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.

      Specified by:
      retry in interface RetryRegistry
      Parameters:
      name - the name of the Retry
      tags - tags added to the Retry
      Returns:
      The Retry
    • retry

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

      public Retry retry(String name, RetryConfig config, Map<String,String> tags)
      Description copied from interface: RetryRegistry
      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.

      Specified by:
      retry in interface RetryRegistry
      Parameters:
      name - the name of the Retry
      config - a custom Retry configuration
      tags - tags added to the Retry
      Returns:
      The Retry
    • retry

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

      public Retry retry(String name, Supplier<RetryConfig> retryConfigSupplier, Map<String,String> tags)
      Description copied from interface: RetryRegistry
      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.

      Specified by:
      retry in interface RetryRegistry
      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

      public 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).
      Specified by:
      retry in interface RetryRegistry
      Parameters:
      name - the name of the Retry
      configName - the name of the shared configuration
      Returns:
      The Retry
    • retry

      public Retry retry(String name, String configName, Map<String,String> tags)
      Description copied from interface: RetryRegistry
      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.

      Specified by:
      retry in interface RetryRegistry
      Parameters:
      name - the name of the Retry
      configName - the name of the shared configuration
      tags - tags added to the Retry
      Returns:
      The Retry