Trying to create Feature Toggles using Togglz. Made below configurations/code in my Application,
bootstrap.yml:
togglz:
enabled: true
features:
FEATURE_ONE: true
Feature Enum Class:
public enum AppFeatures implements Feature {
@Label("FEATURE_ONE") FEATURE_ONE;
public boolean isActive() {
return FeatureContext.getFeatureManager().isActive(this);
}
}
My Requirement:
I need to do like this, if FEATURE_ONE is configured true in yml file, then if condition, else, else has to execute..
if(AppFeatures.FEATURE_ONE.isActive()){}else{}
but my expectation not happening. Though I have given true in yml file, AppFeatures.FEATURE_ONE.isActive() is not true, help/guide me to figure out where am making mistake.
Note am using, togglz 2.4.1 final and springboot 1.3.3, I need enabling/disabling should be done in yml only, not in enum class.