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;
}
Aggregations