Skip to content

quarkiverse/quarkus-flags

Repository files navigation

Quarkus Feature Flags

Version

A lightweight and extensible feature flag extension for Quarkus. Turn features on and off, roll out gradually, or switch behavior based on context — all with a simple and intuitive API.

Quick Start

Add the dependency to your project:

<dependency>
    <groupId>io.quarkiverse.flags</groupId>
    <artifactId>quarkus-flags</artifactId>
    <version>LATEST</version>
</dependency>

Define a feature flag:

quarkus.flags.runtime."my-feature".value=true

Use it in your code:

@Inject
Flags flags;

void doWork() {
    if (Flag.get("my-feature").isEnabled()) {
        // static access — no injection needed
    }
    if (flags.isEnabled("my-feature")) {
        // Flags central entry point
    }
}

Features

  • Simple API — inject Flags, use static Flag.get(), or declare flags with @RegisterFlag on static fields and methods.
  • Multiple value types — boolean, string, integer, and decimal.
  • Built-in providers — define flags via Quarkus config, declarative @RegisterFlag annotations, or the in-memory repository for testing.
  • Built-in evaluators — time span, composite, and variant evaluators out of the box.
  • Caching — built-in in-memory cache for flag provider results with configurable TTL and per-provider overrides; extensible via the FlagCache SPI, with an optional quarkus-flags-cache module backed by Quarkus Cache.
  • Extensible SPI — implement custom FlagProvider or FlagEvaluator to fit your needs.
  • Hibernate ORM and Hibernate Reactive — load flags from a database.
  • Security — evaluate flags based on the current SecurityIdentity, including percentage-based rollouts.
  • Qute — use flags directly in templates.
  • Cron — enable flags on a schedule using CRON expressions.
  • OpenFeature — integrate with the OpenFeature standard.

Documentation

Full documentation is available at https://docs.quarkiverse.io/quarkus-flags/dev/.

About

A lightweight and extensible feature flag extension

Topics

Resources

License

Stars

6 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors