Class InMemoryRateLimiterRegistry

    • Constructor Detail

      • InMemoryRateLimiterRegistry

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

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

        public InMemoryRateLimiterRegistry​(java.util.Map<java.lang.String,​RateLimiterConfig> configs)
      • InMemoryRateLimiterRegistry

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

        public InMemoryRateLimiterRegistry​(java.util.Map<java.lang.String,​RateLimiterConfig> configs,
                                           io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter> registryEventConsumer)
      • InMemoryRateLimiterRegistry

        public InMemoryRateLimiterRegistry​(java.util.Map<java.lang.String,​RateLimiterConfig> configs,
                                           io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter> registryEventConsumer,
                                           io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
      • InMemoryRateLimiterRegistry

        public InMemoryRateLimiterRegistry​(java.util.Map<java.lang.String,​RateLimiterConfig> configs,
                                           java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter>> registryEventConsumers)
      • InMemoryRateLimiterRegistry

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

        public InMemoryRateLimiterRegistry​(RateLimiterConfig defaultConfig)
        The constructor with custom default config.
        Parameters:
        defaultConfig - The default config.
      • InMemoryRateLimiterRegistry

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

        public InMemoryRateLimiterRegistry​(RateLimiterConfig defaultConfig,
                                           io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter> registryEventConsumer)
      • InMemoryRateLimiterRegistry

        public InMemoryRateLimiterRegistry​(RateLimiterConfig defaultConfig,
                                           io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter> registryEventConsumer,
                                           io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
      • InMemoryRateLimiterRegistry

        public InMemoryRateLimiterRegistry​(RateLimiterConfig defaultConfig,
                                           java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter>> registryEventConsumers)
      • InMemoryRateLimiterRegistry

        public InMemoryRateLimiterRegistry​(RateLimiterConfig defaultConfig,
                                           java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter>> registryEventConsumers,
                                           io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
      • InMemoryRateLimiterRegistry

        public InMemoryRateLimiterRegistry​(java.util.Map<java.lang.String,​RateLimiterConfig> configs,
                                           java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<RateLimiter>> registryEventConsumers,
                                           io.vavr.collection.Map<java.lang.String,​java.lang.String> tags,
                                           io.github.resilience4j.core.RegistryStore<RateLimiter> registryStore)
    • Method Detail

      • rateLimiter

        public RateLimiter rateLimiter​(java.lang.String name,
                                       io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
        Returns a managed RateLimiter or creates a new one with the default RateLimiter 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:
        rateLimiter in interface RateLimiterRegistry
        Parameters:
        name - the name of the RateLimiter
        tags - tags added to the RateLimiter
        Returns:
        The RateLimiter
      • rateLimiter

        public RateLimiter rateLimiter​(java.lang.String name,
                                       RateLimiterConfig config,
                                       io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
        Returns a managed RateLimiter or creates a new one with a custom RateLimiter 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:
        rateLimiter in interface RateLimiterRegistry
        Parameters:
        name - the name of the RateLimiter
        config - a custom RateLimiter configuration
        tags - tags added to the RateLimiter
        Returns:
        The RateLimiter
      • rateLimiter

        public RateLimiter rateLimiter​(java.lang.String name,
                                       java.util.function.Supplier<RateLimiterConfig> rateLimiterConfigSupplier)
        Returns a managed RateLimiterConfig or creates a new one with a custom RateLimiterConfig configuration.
        Specified by:
        rateLimiter in interface RateLimiterRegistry
        Parameters:
        name - the name of the RateLimiterConfig
        rateLimiterConfigSupplier - a supplier of a custom RateLimiterConfig configuration
        Returns:
        The RateLimiterConfig
      • rateLimiter

        public RateLimiter rateLimiter​(java.lang.String name,
                                       java.util.function.Supplier<RateLimiterConfig> rateLimiterConfigSupplier,
                                       io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
        Returns a managed RateLimiterConfig or creates a new one with a custom RateLimiterConfig 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:
        rateLimiter in interface RateLimiterRegistry
        Parameters:
        name - the name of the RateLimiterConfig
        rateLimiterConfigSupplier - a supplier of a custom RateLimiterConfig configuration
        tags - tags added to the RateLimiter
        Returns:
        The RateLimiterConfig
      • rateLimiter

        public RateLimiter rateLimiter​(java.lang.String name,
                                       java.lang.String configName)
        Returns a managed RateLimiter or creates a new one. The configuration must have been added upfront via Registry.addConfiguration(String, Object).
        Specified by:
        rateLimiter in interface RateLimiterRegistry
        Parameters:
        name - the name of the RateLimiter
        configName - the name of the shared configuration
        Returns:
        The RateLimiter
      • rateLimiter

        public RateLimiter rateLimiter​(java.lang.String name,
                                       java.lang.String configName,
                                       io.vavr.collection.Map<java.lang.String,​java.lang.String> tags)
        Returns a managed RateLimiter or creates a new one. The configuration must have been added upfront via Registry.addConfiguration(String, Object).
        Specified by:
        rateLimiter in interface RateLimiterRegistry
        Parameters:
        name - the name of the RateLimiter
        configName - the name of the shared configuration
        Returns:
        The RateLimiter