Member-only story
Togglz — Feature Toggles pattern for Java (Spring)
Togglz is an implementation of pattern in Java. 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.
Example Using Spring Boot
In the example below, we will be implementing a toggle using Spring Boot, and MongoDb as our state store repository (Github link for the project can be found at the end of this article).
First of all we need to download the required dependencies:
Here togglz-console will provide us a nice admin panel to manage all our toggles, and togglz-mongodb will be used to persist the state of our toggles
Next, we need to define a config file for our toggle with the following minimal configuration: