Java Code Examples for io.github.resilience4j.retry.RetryConfig#ofDefaults()

The following examples show how to use io.github.resilience4j.retry.RetryConfig#ofDefaults() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InMemoryRetryRegistryTest.java    From resilience4j with Apache License 2.0 6 votes vote down vote up
@Test
public void shouldCreateRetryRegistryWithRegistryStore() {
    RegistryEventConsumer<Retry> registryEventConsumer = getNoOpsRegistryEventConsumer();
    List<RegistryEventConsumer<Retry>> registryEventConsumers = new ArrayList<>();
    registryEventConsumers.add(registryEventConsumer);
    Map<String, RetryConfig> configs = new HashMap<>();
    final RetryConfig defaultConfig = RetryConfig.ofDefaults();
    configs.put("default", defaultConfig);
    final InMemoryRetryRegistry inMemoryRetryRegistry =
        new InMemoryRetryRegistry(configs, registryEventConsumers,
            io.vavr.collection.HashMap.of("Tag1", "Tag1Value"), new InMemoryRegistryStore());

    assertThat(inMemoryRetryRegistry).isNotNull();
    assertThat(inMemoryRetryRegistry.getDefaultConfig()).isEqualTo(defaultConfig);
    assertThat(inMemoryRetryRegistry.getConfiguration("testNotFound")).isEmpty();
    inMemoryRetryRegistry.addConfiguration("testConfig", defaultConfig);
    assertThat(inMemoryRetryRegistry.getConfiguration("testConfig")).isNotNull();
}
 
Example 2
Source File: InMemoryRetryRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
/**
 * The constructor with default default.
 */
public InMemoryRetryRegistry() {
    this(RetryConfig.ofDefaults());
}
 
Example 3
Source File: InMemoryRetryRegistry.java    From resilience4j with Apache License 2.0 4 votes vote down vote up
public InMemoryRetryRegistry(io.vavr.collection.Map<String, String> tags) {
    this(RetryConfig.ofDefaults(), tags);
}