0

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

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
Akhila
  • 41
  • 4
  • You can create a custom annotation and handle your configuration. check this out: https://www.baeldung.com/java-custom-annotation – Habil Aug 21 '20 at 07:09
  • The documentation is showing how to do it in Java (don't follow the 5 minute tutorial as that is old), also feature config is in Java. So what makes you think you must need XML? – M. Deinum Aug 21 '20 at 08:55
  • Thanks, I have looked at the documentation, created FF4JConfiguration to read from datasource. It works. – Akhila Aug 24 '20 at 18:54

2 Answers2

0

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.

Mike Jarsoon
  • 129
  • 2
0

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

clunven
  • 1,360
  • 6
  • 13