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

      Nested Classes 
      Modifier and Type Interface Description
      static class  RetryRegistry.Builder  
      • Nested classes/interfaces inherited from interface io.github.resilience4j.core.Registry

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

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      static RetryRegistry.Builder custom()
      Returns a builder to create a custom RetryRegistry.
      io.vavr.collection.Seq<Retry> getAllRetries()
      Returns all managed Retry instances.
      static RetryRegistry of​(RetryConfig retryConfig)
      Creates a RetryRegistry with a custom default Retry configuration.
      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.
      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.
      static RetryRegistry of​(java.util.Map<java.lang.String,​RetryConfig> configs)
      Creates a RetryRegistry with a Map of shared Retry configurations.
      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.
      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.
      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.
      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.
      static RetryRegistry ofDefaults()
      Creates a RetryRegistry with a default Retry configuration.
      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 interface io.github.resilience4j.core.Registry

        addConfiguration, find, getConfiguration, getDefaultConfig, getEventPublisher, getTags, remove, replace
    • 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 configurations
        tags - 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 managed Retry instances.
        Returns:
        all managed Retry instances.
      • retry

        Retry retry​(java.lang.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​(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.

        Parameters:
        name - the name of the Retry
        tags - tags added to the Retry
        Returns:
        The Retry
      • retry

        Retry retry​(java.lang.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​(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.

        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​(java.lang.String name,
                    java.util.function.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​(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.

        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​(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).
        Parameters:
        name - the name of the Retry
        configName - 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 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