Togglz Yml/Yaml Configuration for My SpringBoot Not working

假如想象 提交于 2020-01-03 03:56:06

问题


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.

来源:https://stackoverflow.com/questions/45318351/togglz-yml-yaml-configuration-for-my-springboot-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!