@Bean
    public RetryRegistry retryRegistry(RetryConfigurationProperties retryConfigurationProperties,
        EventConsumerRegistry<RetryEvent> retryEventConsumerRegistry,
        RegistryEventConsumer<Retry> retryRegistryEventConsumer,
        @Qualifier("compositeRetryCustomizer") CompositeCustomizer<RetryConfigCustomizer> compositeRetryCustomizer) {
        RetryRegistry retryRegistry = createRetryRegistry(retryConfigurationProperties,
            retryRegistryEventConsumer, compositeRetryCustomizer);
        registerEventConsumer(retryRegistry, retryEventConsumerRegistry,
            retryConfigurationProperties);
        retryConfigurationProperties.getInstances()
            .forEach((name, properties) ->
                retryRegistry.retry(name, retryConfigurationProperties
                    .createRetryConfig(name, compositeRetryCustomizer)));
        return retryRegistry;
    }
@Test
    public void testRetryRegistry() {
        InstanceProperties instanceProperties1 = new InstanceProperties();
        instanceProperties1.setMaxAttempts(3);
        InstanceProperties instanceProperties2 = new InstanceProperties();
        instanceProperties2.setMaxAttempts(2);
        RetryConfigurationProperties retryConfigurationProperties = new RetryConfigurationProperties();
        retryConfigurationProperties.getInstances().put("backend1", instanceProperties1);
        retryConfigurationProperties.getInstances().put("backend2", instanceProperties2);
        retryConfigurationProperties.setRetryAspectOrder(200);
        RetryConfiguration retryConfiguration = new RetryConfiguration();
        DefaultEventConsumerRegistry<RetryEvent> eventConsumerRegistry = new DefaultEventConsumerRegistry<>();

        RetryRegistry retryRegistry = retryConfiguration
            .retryRegistry(retryConfigurationProperties, eventConsumerRegistry,
                new CompositeRegistryEventConsumer<>(emptyList()), compositeRetryCustomizerTest());

        assertThat(retryConfigurationProperties.getRetryAspectOrder()).isEqualTo(200);
        assertThat(retryRegistry.getAllRetries().size()).isEqualTo(2);
        Retry retry1 = retryRegistry.retry("backend1");
        assertThat(retry1).isNotNull();
        assertThat(retry1.getRetryConfig().getMaxAttempts()).isEqualTo(3);
        Retry retry2 = retryRegistry.retry("backend2");
        assertThat(retry2).isNotNull();
        assertThat(retry2.getRetryConfig().getMaxAttempts()).isEqualTo(2);
        assertThat(eventConsumerRegistry.getAllEventConsumer()).hasSize(2);
    }