In the disruptive world, business wants to experiment a feature for a time period in production, operational team inspect a feature with resource consumption, developers want to be up to date with trunk branch while their development spans for a long time. How all this happen and still application/product works without any hassles?

It can be solved by toggle points protected and accessed on demand which is called feature flags. To know more about, refer RefCard. Instead of many hanging custom made code, if we have library which can organize all the flags horizontally across the software it will be easy. So Togglz does that!

Introduction

Togglz is an implementation of the Feature Toggles pattern for Java. It is easy to maintain the feature flags in agile development of continuous delivery practices. All the feature states are configured on one location and feature flags incorporated on the implemented places. State of a feature flags can be activated (enabled) or inactive(disabled) by a properties. It can also be done by activation strategy, like when this condition meets, activate the flag.

Togglz ships with the following default strategies:

The strategies are easily understandable from their names, if any details required, it hyperlinks to the actual togglz documentation. We can develop our own custom strategies for activation by implementing the interface ActivationStrategy. Togglz does the service loader mechanism for activation. To do that, we need to register implementation by creating the file called META-INF/services/org.togglz.core.spi.ActivationStrategy which tells the fully qualified implementation class.

Feature State repositories can be maintained in-memory, properties file based, jdbc for rdms databases, monogo databases. We can also add caching state for these repositories. One more thing, togglz requires user information to toggle based on users, so user provider to be configured with Togglz.

#java #tutorial #integration #springboot #feature flags #togglz

Togglz With Spring Boot Integration
7.15 GEEK