Register feature manager for database persistence
@Bean
public FeatureManager featureManager(DataSource dataSource){
return new DefaultFeatureManager()
.featureMetadataProvider(new EnumFeatureMetadataProvider())
.featureRepository(new JDBCFeatureRepository(dataSource))
;
}
Create your Feature enum
public enum Parameter implements InteractiveFeature {
@FeatureDefaults(status = Status.ACTIVE, value = "Congrats!")
FREE_COINS
;
@Override
public FeatureManager manager() {
return FeatureContext.getFeatureManager();
}
}
Using
Parameter.FREE_COINS.isActive();
FeatureSwitchJMX.register();