I’m new to Togglz and there is not much documentation on this problem, nor have I found a solution from searching the web and Stack overflow. (I found one person asking the same question but he wasn’t given a solution). I’m trying to write a POC using Togglz.
I have an existing Spring boot 2 project and am using Togglz 3.3.3.
I have defined some feature flags in an enum. One of these feature flags (FEATURE_TWO), I want to be active only if the current spring profile is “dev”. This is the enum:
public enum TogglzFeatureFlags implements Feature {
@EnabledByDefault
@Label("First feature")
FEATURE_ONE,
@Label("Second feature")
@DefaultActivationStrategy(id = SpringProfileActivationStrategy.ID, parameters = {
@ActivationParameter(name = SpringProfileActivationStrategy.PARAM_PROFILES, value = "dev")
})
FEATURE_TWO,
@Label("Third feature")
FEATURE_THREE;
public boolean isActive() {
return FeatureContext.getFeatureManager().isActive(this);
}
}
When I start up the application in dev and go to the Togglz console, it seems to be recognising the activation strategy (It reads Spring profile: dev) but that feature remains red and disabled, even when in the dev profile.
Togglz console
Does anyone know a fix for this please?
Thanks in advance.
ChrisBr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.