@Bean
    public RateLimiterRegistry rateLimiterRegistry(
        RateLimiterConfigurationProperties rateLimiterProperties,
        EventConsumerRegistry<RateLimiterEvent> rateLimiterEventsConsumerRegistry,
        RegistryEventConsumer<RateLimiter> rateLimiterRegistryEventConsumer,
        @Qualifier("compositeRateLimiterCustomizer") CompositeCustomizer<RateLimiterConfigCustomizer> compositeRateLimiterCustomizer) {
        RateLimiterRegistry rateLimiterRegistry = createRateLimiterRegistry(rateLimiterProperties,
            rateLimiterRegistryEventConsumer, compositeRateLimiterCustomizer);
        registerEventConsumer(rateLimiterRegistry, rateLimiterEventsConsumerRegistry,
            rateLimiterProperties);
        rateLimiterProperties.getInstances().forEach(
            (name, properties) ->
                rateLimiterRegistry
                    .rateLimiter(name, rateLimiterProperties
                        .createRateLimiterConfig(properties, compositeRateLimiterCustomizer, name))
        );
        return rateLimiterRegistry;
    }
@Test
    public void testRateLimiterRegistry() {
        io.github.resilience4j.common.ratelimiter.configuration.CommonRateLimiterConfigurationProperties.InstanceProperties instanceProperties1 = new io.github.resilience4j.common.ratelimiter.configuration.CommonRateLimiterConfigurationProperties.InstanceProperties();
        instanceProperties1.setLimitForPeriod(2);
        instanceProperties1.setSubscribeForEvents(true);
        io.github.resilience4j.common.ratelimiter.configuration.CommonRateLimiterConfigurationProperties.InstanceProperties instanceProperties2 = new io.github.resilience4j.common.ratelimiter.configuration.CommonRateLimiterConfigurationProperties.InstanceProperties();
        instanceProperties2.setLimitForPeriod(4);
        instanceProperties2.setSubscribeForEvents(true);
        RateLimiterConfigurationProperties rateLimiterConfigurationProperties = new RateLimiterConfigurationProperties();
        rateLimiterConfigurationProperties.getInstances().put("backend1", instanceProperties1);
        rateLimiterConfigurationProperties.getInstances().put("backend2", instanceProperties2);
        rateLimiterConfigurationProperties.setRateLimiterAspectOrder(300);
        RateLimiterConfiguration rateLimiterConfiguration = new RateLimiterConfiguration();
        DefaultEventConsumerRegistry<RateLimiterEvent> eventConsumerRegistry = new DefaultEventConsumerRegistry<>();

        RateLimiterRegistry rateLimiterRegistry = rateLimiterConfiguration
            .rateLimiterRegistry(rateLimiterConfigurationProperties, eventConsumerRegistry,
                new CompositeRegistryEventConsumer<>(emptyList()),
                compositeRateLimiterCustomizerTest());

        assertThat(rateLimiterConfigurationProperties.getRateLimiterAspectOrder()).isEqualTo(300);
        assertThat(rateLimiterRegistry.getAllRateLimiters().size()).isEqualTo(2);
        RateLimiter rateLimiter = rateLimiterRegistry.rateLimiter("backend1");
        assertThat(rateLimiter).isNotNull();
        assertThat(rateLimiter.getRateLimiterConfig().getLimitForPeriod()).isEqualTo(2);
        RateLimiter rateLimiter2 = rateLimiterRegistry.rateLimiter("backend2");
        assertThat(rateLimiter2).isNotNull();
        assertThat(rateLimiter2.getRateLimiterConfig().getLimitForPeriod()).isEqualTo(4);
        assertThat(eventConsumerRegistry.getAllEventConsumer()).hasSize(2);
    }