@Test public void testCustomizeTimeLimiterConfig() { TimeLimiterConfigurationProperties timeLimiterConfigurationProperties = new TimeLimiterConfigurationProperties(); TimeLimiterConfigCustomizer customizer = TimeLimiterConfigCustomizer.of("backend", builder -> builder.timeoutDuration(Duration.ofSeconds(10))); TimeLimiterConfigurationProperties.InstanceProperties instanceProperties = new TimeLimiterConfigurationProperties.InstanceProperties(); instanceProperties.setTimeoutDuration(Duration.ofSeconds(3)); TimeLimiterConfig config = timeLimiterConfigurationProperties.createTimeLimiterConfig("backend", instanceProperties, new CompositeCustomizer<>(Collections.singletonList(customizer))); assertThat(config).isNotNull(); assertThat(config.getTimeoutDuration()).isEqualTo(Duration.ofSeconds(10)); }
public TimeLimiterConfig createTimeLimiterConfig(String backendName, @Nullable InstanceProperties instanceProperties, CompositeCustomizer<TimeLimiterConfigCustomizer> compositeTimeLimiterCustomizer) { if (instanceProperties == null) { return TimeLimiterConfig.ofDefaults(); } if (StringUtils.isNotEmpty(instanceProperties.getBaseConfig())) { InstanceProperties baseProperties = configs.get(instanceProperties.getBaseConfig()); if (baseProperties == null) { throw new ConfigurationNotFoundException(instanceProperties.getBaseConfig()); } return buildConfigFromBaseConfig(baseProperties, instanceProperties, compositeTimeLimiterCustomizer, backendName); } return buildTimeLimiterConfig(TimeLimiterConfig.custom(), instanceProperties, compositeTimeLimiterCustomizer, backendName); }
TimeLimiterConfigurationProperties extends CommonProperties { public TimeLimiterConfig createTimeLimiterConfig(String backendName, @Nullable InstanceProperties instanceProperties, CompositeCustomizer<TimeLimiterConfigCustomizer> compositeTimeLimiterCustomizer) { if (instanceProperties == null) { return TimeLimiterConfig.ofDefaults(); } if (StringUtils.isNotEmpty(instanceProperties.getBaseConfig())) { InstanceProperties baseProperties = configs.get(instanceProperties.getBaseConfig()); if (baseProperties == null) { throw new ConfigurationNotFoundException(instanceProperties.getBaseConfig()); } return buildConfigFromBaseConfig(baseProperties, instanceProperties, compositeTimeLimiterCustomizer, backendName); } return buildTimeLimiterConfig(TimeLimiterConfig.custom(), instanceProperties, compositeTimeLimiterCustomizer, backendName); } }
TimeLimiterConfigurationProperties extends CommonProperties { public TimeLimiterConfig createTimeLimiterConfig(String backendName, @Nullable InstanceProperties instanceProperties, CompositeCustomizer<TimeLimiterConfigCustomizer> compositeTimeLimiterCustomizer) { if (instanceProperties == null) { return TimeLimiterConfig.ofDefaults(); } if (StringUtils.isNotEmpty(instanceProperties.getBaseConfig())) { InstanceProperties baseProperties = configs.get(instanceProperties.getBaseConfig()); if (baseProperties == null) { throw new ConfigurationNotFoundException(instanceProperties.getBaseConfig()); } return buildConfigFromBaseConfig(baseProperties, instanceProperties, compositeTimeLimiterCustomizer, backendName); } return buildTimeLimiterConfig(TimeLimiterConfig.custom(), instanceProperties, compositeTimeLimiterCustomizer, backendName); }  }
TimeLimiterConfigurationProperties extends CommonProperties { public TimeLimiterConfig createTimeLimiterConfig(String backendName, @Nullable InstanceProperties instanceProperties, CompositeCustomizer<TimeLimiterConfigCustomizer> compositeTimeLimiterCustomizer) { if (instanceProperties == null) { return TimeLimiterConfig.ofDefaults(); } if (StringUtils.isNotEmpty(instanceProperties.getBaseConfig())) { InstanceProperties baseProperties = configs.get(instanceProperties.getBaseConfig()); if (baseProperties == null) { throw new ConfigurationNotFoundException(instanceProperties.getBaseConfig()); } return buildConfigFromBaseConfig(baseProperties, instanceProperties, compositeTimeLimiterCustomizer, backendName); } return buildTimeLimiterConfig(TimeLimiterConfig.custom(), instanceProperties, compositeTimeLimiterCustomizer, backendName); }  Map<String, InstanceProperties> getInstances(); Map<String, InstanceProperties> getConfigs(); @Nullable InstanceProperties getInstanceProperties(String backend); TimeLimiterConfig createTimeLimiterConfig(String backendName,
        @Nullable InstanceProperties instanceProperties,
        CompositeCustomizer<TimeLimiterConfigCustomizer> compositeTimeLimiterCustomizer); TimeLimiterConfig createTimeLimiterConfig(String limiter); }
TimeLimiterConfigurationProperties extends CommonProperties { public TimeLimiterConfig createTimeLimiterConfig(String backendName, @Nullable InstanceProperties instanceProperties, CompositeCustomizer<TimeLimiterConfigCustomizer> compositeTimeLimiterCustomizer) { if (instanceProperties == null) { return TimeLimiterConfig.ofDefaults(); } if (StringUtils.isNotEmpty(instanceProperties.getBaseConfig())) { InstanceProperties baseProperties = configs.get(instanceProperties.getBaseConfig()); if (baseProperties == null) { throw new ConfigurationNotFoundException(instanceProperties.getBaseConfig()); } return buildConfigFromBaseConfig(baseProperties, instanceProperties, compositeTimeLimiterCustomizer, backendName); } return buildTimeLimiterConfig(TimeLimiterConfig.custom(), instanceProperties, compositeTimeLimiterCustomizer, backendName); }  Map<String, InstanceProperties> getInstances(); Map<String, InstanceProperties> getConfigs(); @Nullable InstanceProperties getInstanceProperties(String backend); TimeLimiterConfig createTimeLimiterConfig(String backendName,
        @Nullable InstanceProperties instanceProperties,
        CompositeCustomizer<TimeLimiterConfigCustomizer> compositeTimeLimiterCustomizer); TimeLimiterConfig createTimeLimiterConfig(String limiter);  }