Skip to content

sideshowcoder/dropwizard-openfeature

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dropwizard Openfeature

This plugin integrates openfeature with dropwizard and allows you to use openfeature feature flags, provided by supported openfeature providers via a managed OpenFeatureAPI instance.

Currently only flagd and the SDKs InMemoryProvider providers are supported

Installing the bundle from source code

git clone https://github.com/sideshowcoder/dropwizard-openfeature
cd dropwizard-openfeature
./mvn install

After installing the plugin locally you can include it in your pom.xml

<dependency>
  <groupId>io.github.sideshowcoder</groupId>
  <artifactId>dropwizard-openfeature</artifactId>
  <version>$VERSION</version>
</dependency>

Included in the bundle

Supported providers

The bundle currently supports both the SDK included InMemoryProvider as well as flagd, the provider can be selected via the configuration. For details on the configuration options see FlagdConfiguration as well the flagd documentation.

OpenFeatureAPI management

The initialized OpenFeatureAPI is managed via the dropwizard lifecycle.

Healthcheck

By default the bundle registers a healthcheck on the state of the provider configured, this healthcheck can be further configured via the OpenFeatureHealthCheckConfiguration.

Activating the bundle: Configuration

Your Dropwizard application configuration class must implement OpenFeatureBundleConfiguration:

Configuring dropwizard-openfeature in the dropwizard config file

For a full overview see OpenFeatureConfiguration, OpenFeatureHealthCheckConfiguration, and FlagdConfiguration a minimal configuration for flagd runnining locally on the port 8013 would look as follows.

openfeature:
  provider: flagd
  flagd:
    host: localhost
    port: 8013

For the bundle to have access to the configuration, your application configuration needs to implement OpenFeatureBundleConfiguration.

import io.github.sideshowcoder.dropwizard_openfeature.OpenFeatureConfiguration;

public class ApplicationConfiguration implements OpenFeatureBundleConfiguration {

    @Valid
    @NotNull
    @JsonProperty
    private OpenFeatureConfiguration openfeature;

    @Override
    public OpenFeatureConfiguration getOpenFeatureConfiguration() {
        return openfeature;
    }
}

Activating the bundle: Initialization

In your application's initialize method, call bootstrap.addBundle(new OpenFeatureBundle()):

import io.github.sideshowcoder.dropwizard_openfeature.OpenFeatureBundle;

@Override
public void initialize(Bootstrap<MyConfiguration> bootstrap) {
    bootstrap.addBundle(new OpenFeatureBundle());
}

Contributors

About

OpenFeature Bundle for Dropwizard

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •  

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy