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.
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=trueUse 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
}
}- Simple API — inject
Flags, use staticFlag.get(), or declare flags with@RegisterFlagon static fields and methods. - Multiple value types — boolean, string, integer, and decimal.
- Built-in providers — define flags via Quarkus config, declarative
@RegisterFlagannotations, 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
FlagCacheSPI, with an optionalquarkus-flags-cachemodule backed by Quarkus Cache. - Extensible SPI — implement custom
FlagProviderorFlagEvaluatorto 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.
Full documentation is available at https://docs.quarkiverse.io/quarkus-flags/dev/.