GO Feature Flag Provider

The GO Feature Flag provider connects to a GO Feature Flag relay proxy and evaluates feature flags in-process. Flag definitions are fetched over HTTP and kept up-to-date via Server-Sent Events (SSE), then evaluated locally using a compiled WebAssembly engine, so no network call is made during flag evaluation.

This extension depends on:

Component Version Source

GO Feature Flag engine (WASM)

0.2.2

go-feature-flag/wasm-releases

Installation

<dependency>
    <groupId>io.quarkiverse.openfeature</groupId>
    <artifactId>quarkus-openfeature-gofeatureflag</artifactId>
    <version>1.0.0.Alpha1</version>
</dependency>

Configuration

By default, the provider connects to http://localhost:1031. To connect to a different relay proxy:

quarkus.openfeature.gofeatureflag.url=https://goff.example.com

For named domains:

quarkus.openfeature."experimentation".gofeatureflag.url=https://goff-experiments.example.com

TLS

The provider uses the Quarkus TLS registry for TLS configuration. First, configure a named TLS configuration in application.properties, then reference it:

quarkus.tls.goff.trust-store.pem.certs=ca.pem

quarkus.openfeature.gofeatureflag.tls-configuration-name=goff

See the Quarkus TLS registry documentation for all available options.

Authentication

The provider supports API key authentication:

quarkus.openfeature.gofeatureflag.api-key=my-secret-key

Setting api-key directly in configuration is suitable for development and testing. For production, use a credentials provider such as Vault:

quarkus.openfeature.gofeatureflag.credentials-provider=goff-token
quarkus.openfeature.gofeatureflag.credentials-provider-name=vault-credentials-provider

Evaluation context

A targeting key is mandatory in GO Feature Flag and if it is missing, the evaluation may return an error with code TARGETING_KEY_MISSING. All other context attributes are passed through to the evaluation engine as generic context properties.

Dev Services

In dev and test mode, a GO Feature Flag relay proxy container is started automatically if no quarkus.openfeature.gofeatureflag.url is configured and Docker is available. If no flag definition file is found, the relay proxy starts with an empty configuration.

To provide flag definitions to the dev service, place a flags.goff.yaml file in src/main/resources:

my-feature:
  variations:
    enabled: true
    disabled: false
  defaultRule:
    variation: enabled

greeting:
  variations:
    hello: hello
    howdy: howdy
  defaultRule:
    variation: hello

The dev service picks up this file automatically. You can also configure a different path:

quarkus.openfeature.gofeatureflag.devservices.path=my-flags.yaml

Changes to the flag definition file are detected during live reload and the application is restarted automatically. The relay proxy picks up the updated file through its own file watcher.

Evaluation concurrency

Flag evaluation runs locally in a WebAssembly engine. Each engine instance can only evaluate one flag at a time, so a pool of engine instances is maintained. The pool size controls the maximum number of concurrent flag evaluations; the default is 16. If all instances are in use, an evaluation request waits up to 100 milliseconds for an instance to become available. If no instance is available within that time, the default value is returned. To increase the pool size:

quarkus.openfeature.gofeatureflag.wasm-instances=32

Connection lifecycle

The provider fetches the full flag configuration on startup and then subscribes to the relay proxy’s SSE stream for real-time updates. On connection loss, it automatically re-fetches the full configuration and reconnects to the stream. The provider lifecycle follows the OpenFeature specification:

READY

The provider has received flag data and is serving evaluations.

STALE

The connection was lost. The provider continues serving cached flag values while reconnecting.

ERROR

The provider did not reconnect within the grace period (default 1 minute).

FATAL

The server returned an authentication error (HTTP 401 or 403). The provider will not attempt to reconnect.

The grace period is configurable:

quarkus.openfeature.gofeatureflag.grace-period=10m

Configuration Reference

Configuration property fixed at build time - All other configuration properties are overridable at runtime

Configuration property

Type

Default

quarkus.openfeature."domain-name".gofeatureflag.url

GO Feature Flag relay proxy URL.

Environment variable: QUARKUS_OPENFEATURE_GOFEATUREFLAG_URL

string

http://localhost:1031

quarkus.openfeature."domain-name".gofeatureflag.api-key

API key for authentication with the relay proxy.

Environment variable: QUARKUS_OPENFEATURE_GOFEATUREFLAG_API_KEY

string

quarkus.openfeature."domain-name".gofeatureflag.credentials-provider

The credentials provider name. This is the key used to look up credentials in the credentials provider.

Environment variable: QUARKUS_OPENFEATURE_GOFEATUREFLAG_CREDENTIALS_PROVIDER

string

quarkus.openfeature."domain-name".gofeatureflag.credentials-provider-name

The credentials provider bean name.

This is a bean name (as in @Named) of a bean that implements CredentialsProvider. It is used to select the credentials provider bean when multiple exist. This is unnecessary when there is only one credentials provider available.

For Vault, the credentials provider bean name is vault-credentials-provider.

Environment variable: QUARKUS_OPENFEATURE_GOFEATUREFLAG_CREDENTIALS_PROVIDER_NAME

string

quarkus.openfeature."domain-name".gofeatureflag.tls-configuration-name

TLS configuration name from the Quarkus TLS registry.

Environment variable: QUARKUS_OPENFEATURE_GOFEATUREFLAG_TLS_CONFIGURATION_NAME

string

quarkus.openfeature."domain-name".gofeatureflag.grace-period

Grace period before transitioning from STALE to ERROR after a connection loss. During this period, the provider continues serving cached flag values while attempting to reconnect. If the connection is restored within the grace period, the provider transitions back to READY without emitting an ERROR event.

Environment variable: QUARKUS_OPENFEATURE_GOFEATUREFLAG_GRACE_PERIOD

Duration 

1M

quarkus.openfeature."domain-name".gofeatureflag.wasm-instances

Number of WASM engine instances in the evaluation pool. Each engine can evaluate one flag at a time, so this controls the maximum concurrency of flag evaluations.

Environment variable: QUARKUS_OPENFEATURE_GOFEATUREFLAG_WASM_INSTANCES

int

16

quarkus.openfeature."domain-name".gofeatureflag.use-quarkus-jackson

Whether to use the Quarkus-managed ObjectMapper from the quarkus-jackson extension. When false, the provider creates its own ObjectMapper instance.

Environment variable: QUARKUS_OPENFEATURE_GOFEATUREFLAG_USE_QUARKUS_JACKSON

boolean

true

About the Duration format

To write duration values, use the standard java.time.Duration format. See the Duration#parse() Java API documentation for more information.

You can also use a simplified format, starting with a number:

  • If the value is only a number, it represents time in seconds.

  • If the value is a number followed by ms, it represents time in milliseconds.

In other cases, the simplified format is translated to the java.time.Duration format for parsing:

  • If the value is a number followed by h, m, or s, it is prefixed with PT.

  • If the value is a number followed by d, it is prefixed with P.