Interface BulkheadRegistry

All Superinterfaces:
io.github.resilience4j.core.Registry<Bulkhead,BulkheadConfig>
All Known Implementing Classes:
InMemoryBulkheadRegistry

public interface BulkheadRegistry extends io.github.resilience4j.core.Registry<Bulkhead,BulkheadConfig>
The BulkheadRegistry is a factory to create Bulkhead instances which stores all bulkhead instances in a registry.
  • Method Details

    • of

      static BulkheadRegistry of(BulkheadConfig bulkheadConfig)
      Creates a BulkheadRegistry with a custom Bulkhead configuration.
      Parameters:
      bulkheadConfig - a custom Bulkhead configuration
      Returns:
      a BulkheadRegistry instance backed by a custom Bulkhead configuration
    • of

      static BulkheadRegistry of(BulkheadConfig bulkheadConfig, Map<String,String> tags)
      Creates a BulkheadRegistry with a custom Bulkhead configuration.

      Tags added to the registry will be added to every instance created by this registry.

      Parameters:
      bulkheadConfig - a custom Bulkhead configuration
      tags - default tags to add to the registry
      Returns:
      a BulkheadRegistry instance backed by a custom Bulkhead configuration
    • of

      static BulkheadRegistry of(BulkheadConfig bulkheadConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead> registryEventConsumer)
      Creates a BulkheadRegistry with a custom default Bulkhead configuration and a Bulkhead registry event consumer.
      Parameters:
      bulkheadConfig - a custom default Bulkhead configuration.
      registryEventConsumer - a Bulkhead registry event consumer.
      Returns:
      a BulkheadRegistry with a custom Bulkhead configuration and a Bulkhead registry event consumer.
    • of

      static BulkheadRegistry of(BulkheadConfig bulkheadConfig, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead>> registryEventConsumers)
      Creates a BulkheadRegistry with a custom default Bulkhead configuration and a list of Bulkhead registry event consumers.
      Parameters:
      bulkheadConfig - a custom default Bulkhead configuration.
      registryEventConsumers - a list of Bulkhead registry event consumers.
      Returns:
      a BulkheadRegistry with a custom Bulkhead configuration and a list of Bulkhead registry event consumers.
    • of

      static BulkheadRegistry of(Map<String,BulkheadConfig> configs)
      Creates a BulkheadRegistry with a Map of shared Bulkhead configurations.
      Parameters:
      configs - a Map of shared Bulkhead configurations
      Returns:
      a RetryRegistry with a Map of shared Bulkhead configurations.
    • of

      static BulkheadRegistry of(Map<String,BulkheadConfig> configs, Map<String,String> tags)
      Creates a BulkheadRegistry with a Map of shared Bulkhead configurations.

      Tags added to the registry will be added to every instance created by this registry.

      Parameters:
      configs - a Map of shared Bulkhead configurations
      tags - default tags to add to the registry
      Returns:
      a RetryRegistry with a Map of shared Bulkhead configurations.
    • of

      static BulkheadRegistry of(Map<String,BulkheadConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead> registryEventConsumer)
      Creates a BulkheadRegistry with a Map of shared Bulkhead configurations and a Bulkhead registry event consumer.
      Parameters:
      configs - a Map of shared Bulkhead configurations.
      registryEventConsumer - a Bulkhead registry event consumer.
      Returns:
      a BulkheadRegistry with a Map of shared Bulkhead configurations and a Bulkhead registry event consumer.
    • of

      static BulkheadRegistry of(Map<String,BulkheadConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead> registryEventConsumer, Map<String,String> tags)
      Creates a BulkheadRegistry with a Map of shared Bulkhead configurations and a Bulkhead registry event consumer.
      Parameters:
      configs - a Map of shared Bulkhead configurations.
      registryEventConsumer - a Bulkhead registry event consumer.
      tags - default tags to add to the registry
      Returns:
      a BulkheadRegistry with a Map of shared Bulkhead configurations and a Bulkhead registry event consumer.
    • of

      static BulkheadRegistry of(Map<String,BulkheadConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead>> registryEventConsumers)
      Creates a BulkheadRegistry with a Map of shared Bulkhead configurations and a list of Bulkhead registry event consumers.
      Parameters:
      configs - a Map of shared Bulkhead configurations.
      registryEventConsumers - a list of Bulkhead registry event consumers.
      Returns:
      a BulkheadRegistry with a Map of shared Bulkhead configurations and a list of Bulkhead registry event consumers.
    • ofDefaults

      static BulkheadRegistry ofDefaults()
      Creates a BulkheadRegistry with a default Bulkhead configuration
      Returns:
      a BulkheadRegistry instance backed by a default Bulkhead configuration
    • getAllBulkheads

      Set<Bulkhead> getAllBulkheads()
      Returns all managed Bulkhead instances.
      Returns:
      all managed Bulkhead instances.
    • bulkhead

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

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

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

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

      Bulkhead bulkhead(String name, Supplier<BulkheadConfig> bulkheadConfigSupplier)
      Returns a managed Bulkhead or creates a new one with a custom Bulkhead configuration.
      Parameters:
      name - the name of the Bulkhead
      bulkheadConfigSupplier - a custom Bulkhead configuration supplier
      Returns:
      The Bulkhead
    • bulkhead

      Bulkhead bulkhead(String name, Supplier<BulkheadConfig> bulkheadConfigSupplier, Map<String,String> tags)
      Returns a managed Bulkhead or creates a new one with a custom Bulkhead 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 Bulkhead
      bulkheadConfigSupplier - a custom Bulkhead configuration supplier
      tags - tags to add to the Bulkhead
      Returns:
      The Bulkhead
    • bulkhead

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

      Bulkhead bulkhead(String name, String configName, Map<String,String> tags)
      Returns a managed Bulkhead 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 Bulkhead
      configName - the name of the shared configuration
      tags - tags to add to the Bulkhead
      Returns:
      The Bulkhead
    • custom

      static BulkheadRegistry.Builder custom()
      Returns a builder to create a custom BulkheadRegistry.
      Returns:
      a BulkheadRegistry.Builder