Admin console not showing FeatureGroups

80 views
Skip to first unread message

Naveen K

unread,
Sep 4, 2018, 2:21:29 PM9/4/18
to togglz-users
Hi Christian & Others

I am trying to get FeatureGroup working.  Somehow, admin UI is not showing the feature groups. With FeatureGroup , if I add flags in application.properties it is still showing as "All Features" (Not as groups). If I don't add in application.properties, console NOT showing any flags at all.  Can you please post some working example for FeatureGroup

1. Do we still need to add the flags in application.properties? 

Below is sample. Let me know if  I miss anything.

public enum TestFeatureEnum implements Feature {

@Label("Enable Feature 1")
@TestFeatureGroup
    
FEATURE_1,

@Label("Enable Geo Filter")
         FILTER;
public boolean isActive() {
return FeatureContext.getFeatureManager().isActive(this);
}
}


TestFeatureGroup.java

@FeatureGroup
@Label("Performance Improvements")
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface TestFeatureGroup {
// no content
}

Christian Kaltepoth

unread,
Sep 5, 2018, 12:41:59 AM9/5/18
to togglz...@googlegroups.com, Rui Figueira
Did you try to define the grouping in the application.properties file as described in the Spring Boot Starter documentation?

AFAIK you have have to choose between either defining everything in application.properties (the feature names and grouping) or reference a enum using the "togglz.feature-enums" in which case the annotation based grouping should work.

@Rui: Can you confirm this?
--

Naveen K

unread,
Sep 5, 2018, 2:29:04 AM9/5/18
to togglz-users
Thanks for the quick response. Tried with  "togglz.feature-enums"  and defined groups correctly in application.properties both works perfectly fine :)

Annotation approach is great, only thing is we need flexibility to change configuration in properties file. 


Can I externalize the feature flags to multiple properties files? Eg., one properties file for each feature group like 

feature.properties                - >           Feature_1, Feature_2         - FeaturesGroup

toggles.properties               ->             toggle_1, toggle_2              - TogglesGroup

Christian Kaltepoth

unread,
Sep 5, 2018, 4:29:05 AM9/5/18
to togglz...@googlegroups.com
The application.properties file is actually a Spring Boot feature. I'm not so familiar with Spring Boot and how to split up configuration like this. Maybe others can help?
Reply all
Reply to author
Forward
0 new messages