How to use FF4J to get the features in java without xml

1.5k Views Asked by At

We are using the FF4J Framework to toggle features in our spring boot application. we manage features using the web console ( Insert/update new features into the DB) that it provides but to use the toggling in java, we are using spring AOP (@Flip annotation) which uses the XML file, so in this case, we will have to manage the feature flags in the database and also in the XML files. Is there any other way in which I can use ff4j in java without XML ( would be better if its annotation-based as it's easy to manage the code) and rather read from the DB in our spring boot application

Also, in the front end angular application, we are using the API ( /api/ff4j/store/features) that it provides to get the features

2

There are 2 best solutions below

0
Mike Jarsoon On

I don't know much about ff4J , seems like very old way of doing dynamic properties, we use Apache Zookeeper to achieve this and we pass necessary values to our front end depending on the endpoints.

0
clunven On

This is not a normal behaviour. The @Flip annotation works with the ff4j bean you defined in your application. Look here at how it is injected here in the bean

In the application, you need to define a proper FF4j with same datastore as the console or it will use a default one.

Check this sample, will update soon with the @Flip annotation class

https://github.com/ff4j/ff4j-samples/tree/master/spring-boot-2x/ff4j-sample-springboot2x