Togglz logo

Togglz

Dynamic runtime feature toggles for Java applications

Togglz provides a robust implementation of the Feature Toggles pattern, enabling Java developers to turn features on or off at runtime, per user or environment, supporting continuous delivery.

Togglz banner

Overview

Overview

Togglz implements the Feature Toggles pattern for Java applications. It lets developers define feature flags that can be turned on or off at runtime, even per user or environment, supporting continuous delivery and safe releases.

Who Can Benefit

The library is aimed at Java teams using frameworks such as Spring, Dropwizard, or plain JVM projects. It provides an admin console, multiple activation strategies, and extensible storage backends, making it suitable for both small services and large, distributed systems.

Deployment

Add the Togglz dependency to your build, configure a Feature enum, and choose a state repository (in‑memory, JDBC, etc.). The console can be embedded or exposed as a separate endpoint, and the library works with any JVM language, including Kotlin and Groovy.

Beyond basic toggling, Togglz supports custom activation strategies, allowing you to combine user attributes, request parameters, or external services to decide flag state. The library’s API is lightweight, requiring only a few lines to check a feature, and it integrates with existing logging and metrics frameworks to give visibility into flag usage.

Because it is Apache‑2.0 licensed and has over a thousand stars on GitHub, Togglz is a mature choice with active maintenance and no open issues, giving confidence for production deployments.

Highlights

Runtime toggling of features without redeploying
Per-user, group, or environment activation strategies
Extensible storage backends (in‑memory, JDBC, etc.)
Built‑in admin console and integration with Spring, Dropwizard, and other Java frameworks

Pros

  • Simple API integrates quickly into existing Java code
  • Supports fine‑grained targeting for gradual rollouts
  • Apache‑2.0 license permits unrestricted commercial use
  • Active community and zero open issues indicate stability

Considerations

  • Limited to JVM languages; not applicable to non‑Java stacks
  • Requires additional configuration for distributed storage in clustered environments
  • Admin console adds a small runtime overhead
  • Learning curve for complex activation strategies

Managed products teams compare with

When teams consider Togglz, these hosted platforms usually appear on the same shortlist.

Hypertune logo

Hypertune

Type-safe feature flags platform with A/B testing, analytics, and app configuration optimized for TypeScript

LaunchDarkly logo

LaunchDarkly

Feature flag management platform for safe software releases with targeting, experimentation, and rollback capabilities

Reflag logo

Reflag

Feature flags and A/B testing for TypeScript

Looking for a hosted option? These are the services engineering teams benchmark against before choosing open source.

Fit guide

Great for

  • Teams practicing continuous delivery who need safe feature releases
  • Java applications that require per‑user or per‑environment feature control
  • Organizations seeking an open‑source, Apache‑2.0 licensed flag system
  • Projects that already use Spring or Dropwizard and want seamless integration

Not ideal when

  • Polyglot microservices where a language‑agnostic solution is preferred
  • Small scripts or utilities where adding a library is overkill
  • Environments with strict latency constraints where any overhead is unacceptable
  • Teams that need a hosted SaaS feature‑flag platform with built‑in analytics

How teams use it

Gradual rollout to 10% of users

Enable a new UI component for a subset of users, monitor performance, then increase exposure without redeploying.

Emergency kill switch for a buggy feature

Turn off the problematic feature instantly across all instances, preventing further errors while a fix is prepared.

A/B testing different algorithms

Serve alternative implementations to distinct user groups, collect metrics, and decide the winning approach.

Beta access for internal testers

Expose experimental functionality only to internal accounts, keeping it hidden from production users.

Tech snapshot

Java97%
Kotlin1%
Groovy1%
HTML1%
Shell1%
CSS1%

Tags

feature-togglesjavafeature-flags

Frequently asked questions

How do I integrate Togglz with Spring Boot?

Add the Togglz starter dependency, define a Feature enum, and configure a FeatureProvider bean; the library auto‑registers a management endpoint.

Can Togglz store flags in a relational database?

Yes, it provides a JDBC state repository; you can plug in any JDBC‑compatible database to persist flag states.

Is Togglz thread‑safe for high‑traffic applications?

The core API is designed for concurrent use; state repositories handle synchronization internally.

Does Togglz work with Kotlin code?

Since Kotlin compiles to JVM bytecode, you can use Togglz exactly as you would in Java.

What license governs Togglz and can I use it commercially?

Togglz is released under the Apache‑2.0 license, allowing free commercial use, modification, and distribution.

Project at a glance

Active
Stars
1,008
Watchers
1,008
Forks
261
LicenseApache-2.0
Repo age14 years old
Last commitlast week
Primary languageJava

Last synced yesterday