Togglz feature flags (Spring Boot)

Introduction

Keywords: Feature Toggles pattern, Feature Flags pattern

Togglz is an implementation of the Feature Toggles pattern for Java. Feature Toggles are a very common agile development practices in the context of continuous deployment and delivery. The basic idea is to associate a toggle with each new feature you are working on. This allows you to enable or disable these features at application runtime, even for individual users.

References

Togglz Feature Flags for the Java platform

https://www.togglz.org/

Feature toggle implementation using Spring boot [w/ Mongo]

https://www.linkedin.com/pulse/feature-toggle-implementation-using-spring-boot-jonnabhatla


Configuration (sample)

Togglz Spring Boot Starter requires Spring Boot >= 2, w/ Java >= 8.


This example was tested using Spring Boot 2.7.8, w/ Java 17.

==> PoC result: Just adding the dependency togglz-spring-boot-starter makes the app to crash on start-up (gave up, for now).


pom.xml

<properties>

<togglz.version>3.3.3</togglz.version>

</properties>


<!-- Togglz [adds togglz-core, togglz-spring-core and enables auto config] (mandatory) -->

<dependency>

<groupId>org.togglz</groupId>

<artifactId>togglz-spring-boot-starter</artifactId>

<version>${togglz.version}</version>

</dependency>


<!-- Togglz Admin Console (optional) -->

<dependency>

<groupId>org.togglz</groupId>

<artifactId>togglz-console</artifactId>

<version>${togglz.version}</version>

</dependency>


<!-- Togglz Spring Security (optional) -->

<dependency>

<groupId>org.togglz</groupId>

<artifactId>togglz-spring-security</artifactId>

<version>${togglz.version}</version>

</dependency>


<!-- Togglz Dialect of Thymeleaf (optional) -->

<!--

<dependency>

<groupId>com.github.heneke.thymeleaf</groupId>

<artifactId>thymeleaf-extras-togglz</artifactId>

<version>2.0.1.RELEASE</version>

</dependency>

-->


Usage (sample)

TBD