Search in sources :

Example 1 with FeatureToggleServiceZk

use of org.zalando.nakadi.service.FeatureToggleServiceZk in project nakadi by zalando.

the class RepositoriesConfig method featureToggleServiceLocal.

@Profile({ "acceptanceTest", "local" })
@Bean
public FeatureToggleService featureToggleServiceLocal(final ZooKeeperHolder zooKeeperHolder, final FeaturesConfig featuresConfig) {
    final FeatureToggleService featureToggleService = new FeatureToggleServiceZk(zooKeeperHolder);
    if (featuresConfig.containsDefaults()) {
        final Set<String> features = featuresConfig.getFeaturesWithDefaultState();
        for (final String feature : features) {
            LOG.info("Setting feature {} to {}", feature, featuresConfig.getDefaultState(feature));
            featureToggleService.setFeature(new FeatureToggleService.FeatureWrapper(FeatureToggleService.Feature.valueOf(feature), featuresConfig.getDefaultState(feature)));
        }
    }
    return featureToggleService;
}
Also used : FeatureToggleServiceZk(org.zalando.nakadi.service.FeatureToggleServiceZk) FeatureToggleService(org.zalando.nakadi.service.FeatureToggleService) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Aggregations

Bean (org.springframework.context.annotation.Bean)1 Profile (org.springframework.context.annotation.Profile)1 FeatureToggleService (org.zalando.nakadi.service.FeatureToggleService)1 FeatureToggleServiceZk (org.zalando.nakadi.service.FeatureToggleServiceZk)1