Class 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.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface io.github.resilience4j.core.Registry

        io.github.resilience4j.core.Registry.EventPublisher<E extends java.lang.Object>
    • Field Summary

      • Fields inherited from class io.github.resilience4j.core.registry.AbstractRegistry

        CONFIG_MUST_NOT_BE_NULL, configurations, CONSUMER_MUST_NOT_BE_NULL, DEFAULT_CONFIG, entryMap, registryTags, SUPPLIER_MUST_NOT_BE_NULL, TAGS_MUST_NOT_BE_NULL
    • Constructor Summary

      Constructors 
      Constructor Description
      InMemoryRetryRegistry()
      The constructor with default default.
      InMemoryRetryRegistry​(RetryConfig defaultConfig)
      The constructor with custom default config.
      InMemoryRetryRegistry​(RetryConfig defaultConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer)  
      InMemoryRetryRegistry​(RetryConfig defaultConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer, io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)  
      InMemoryRetryRegistry​(RetryConfig defaultConfig, io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)  
      InMemoryRetryRegistry​(RetryConfig defaultConfig, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers)  
      InMemoryRetryRegistry​(RetryConfig defaultConfig, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers, io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)  
      InMemoryRetryRegistry​(io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)  
      InMemoryRetryRegistry​(java.util.Map<java.lang.String,​RetryConfig> configs)  
      InMemoryRetryRegistry​(java.util.Map<java.lang.String,​RetryConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Retry> registryEventConsumer)  
      InMemoryRetryRegistry​(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)  
      InMemoryRetryRegistry​(java.util.Map<java.lang.String,​RetryConfig> configs, io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)  
      InMemoryRetryRegistry​(java.util.Map<java.lang.String,​RetryConfig> configs, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers)  
      InMemoryRetryRegistry​(java.util.Map<java.lang.String,​RetryConfig> configs, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers, io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)  
      InMemoryRetryRegistry​(java.util.Map<java.lang.String,​RetryConfig> configs, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers, io.vavr.collection.Map<java.lang.String,​java.lang.String> tags, io.github.resilience4j.core.RegistryStore<Retry> registryStore)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.vavr.collection.Seq<Retry> getAllRetries()
      Returns all managed Retry instances.
      Retry retry​(java.lang.String name)
      Returns a managed Retry or creates a new one with the default Retry configuration.
      Retry retry​(java.lang.String name, RetryConfig config)
      Returns a managed Retry or creates a new one with a custom Retry configuration.
      Retry retry​(java.lang.String name, RetryConfig config, io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
      Returns a managed Retry or creates a new one with a custom Retry configuration.
      Retry retry​(java.lang.String name, io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
      Returns a managed Retry or creates a new one with the default Retry configuration.
      Retry retry​(java.lang.String name, java.lang.String configName)
      Returns a managed Retry or creates a new one.
      Retry retry​(java.lang.String name, java.lang.String configName, io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
      Returns a managed Retry or creates a new one.
      Retry retry​(java.lang.String name, java.util.function.Supplier<RetryConfig> retryConfigSupplier)
      Returns a managed Retry or creates a new one with a custom Retry configuration.
      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 managed Retry or creates a new one with a custom Retry configuration.
      • Methods inherited from class io.github.resilience4j.core.registry.AbstractRegistry

        addConfiguration, computeIfAbsent, find, getAllTags, getConfiguration, getDefaultConfig, getEventPublisher, getTags, remove, replace
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.github.resilience4j.core.Registry

        addConfiguration, find, getConfiguration, getDefaultConfig, getEventPublisher, getTags, remove, replace
    • Constructor Detail

      • InMemoryRetryRegistry

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

        public InMemoryRetryRegistry​(io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
      • InMemoryRetryRegistry

        public InMemoryRetryRegistry​(java.util.Map<java.lang.String,​RetryConfig> configs)
      • InMemoryRetryRegistry

        public InMemoryRetryRegistry​(java.util.Map<java.lang.String,​RetryConfig> configs,
                                     io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
      • InMemoryRetryRegistry

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

        public InMemoryRetryRegistry​(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)
      • InMemoryRetryRegistry

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

        public InMemoryRetryRegistry​(java.util.Map<java.lang.String,​RetryConfig> configs,
                                     java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers,
                                     io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
      • InMemoryRetryRegistry

        public InMemoryRetryRegistry​(java.util.Map<java.lang.String,​RetryConfig> configs,
                                     java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers,
                                     io.vavr.collection.Map<java.lang.String,​java.lang.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,
                                     io.vavr.collection.Map<java.lang.String,​java.lang.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,
                                     io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
      • InMemoryRetryRegistry

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

        public InMemoryRetryRegistry​(RetryConfig defaultConfig,
                                     java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<Retry>> registryEventConsumers,
                                     io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
    • Method Detail

      • retry

        public Retry retry​(java.lang.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​(java.lang.String name,
                           io.vavr.collection.Map<java.lang.String,​java.lang.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​(java.lang.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​(java.lang.String name,
                           RetryConfig config,
                           io.vavr.collection.Map<java.lang.String,​java.lang.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​(java.lang.String name,
                           java.util.function.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​(java.lang.String name,
                           java.util.function.Supplier<RetryConfig> retryConfigSupplier,
                           io.vavr.collection.Map<java.lang.String,​java.lang.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​(java.lang.String name,
                           java.lang.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​(java.lang.String name,
                           java.lang.String configName,
                           io.vavr.collection.Map<java.lang.String,​java.lang.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