You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-25Lines changed: 53 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,19 @@
1
-
[](https://maven-badges.sml.io/sonatype-central/io.github.sideshowcoder/dropwizard-openfeature)
1
+
[](https://maven-badges.sml.io/sonatype-central/io.github.sideshowcoder/dropwizard-openfeature)
2
2
3
3
# Dropwizard Openfeature
4
4
5
-
This plugin integrates [openfeature][1] with dropwizard and allows you to use openfeature feature
6
-
flags, provided by supported openfeature providers via a managed `OpenFeatureAPI` instance.
5
+
This plugin integrates [openfeature][1] with dropwizard and allows you to use
6
+
openfeature feature flags, provided by supported openfeature providers via a
7
+
managed `OpenFeatureAPI` instance.
7
8
8
-
Currently only [flagd][2] and the SDKs [InMemoryProvider][3] providers are supported
9
+
It implements support for
10
+
-[InMemoryProvider][3] useful for testing
11
+
-[flagd][2]
12
+
-[GO Feature Flag][6]
13
+
-[OpenFeature Remote Evaluation Protocol (OFREP)][8] to support any providers implementing it
14
+
15
+
Currently only [flagd][2] and the SDKs [InMemoryProvider][3] providers are
16
+
supported
9
17
10
18
## Installing the bundle
11
19
@@ -17,7 +25,7 @@ Currently only [flagd][2] and the SDKs [InMemoryProvider][3] providers are suppo
17
25
<dependency>
18
26
<groupId>io.github.sideshowcoder</groupId>
19
27
<artifactId>dropwizard-openfeature</artifactId>
20
-
<version>2.0.0</version>
28
+
<version>2.1.0</version>
21
29
</dependency>
22
30
```
23
31
@@ -35,38 +43,49 @@ After installing the plugin locally you can include it in your `pom.xml`
35
43
<dependency>
36
44
<groupId>io.github.sideshowcoder</groupId>
37
45
<artifactId>dropwizard-openfeature</artifactId>
38
-
<version>2.0.1-SNAPSHOT</version>
46
+
<version>2.1.1-SNAPSHOT</version>
39
47
</dependency>
40
48
```
41
49
42
-
43
-
44
50
## Included in the bundle
45
51
46
52
### Supported providers
47
53
48
-
The bundle currently supports both the SDK included `InMemoryProvider` as well as `flagd`, the provider can be selected
49
-
via the configuration. For details on the configuration options see `FlagdConfiguration` as well the
50
-
[flagd documentation][5].
54
+
Currently the following providers, implemented in the
55
+
[open-feature/java-sdk-contrib][11] are supported, and their respective most
56
+
used configuration options are mapped to yaml configuration. Addtional
57
+
configuration can be set by accessing the underlying provider as needed.
58
+
59
+
-[InMemoryProvider][3]
60
+
-[flagd][9]
61
+
-[GO Feature Flag][10]
62
+
-[OpenFeature Remote Evaluation Protocol (OFREP)][7] to support any providers
63
+
implementing it
64
+
65
+
For the configuration see the respective configuration classes.
51
66
52
67
### OpenFeatureAPI management
53
68
54
-
The initialized `OpenFeatureAPI` is managed via the dropwizard lifecycle and will be shutdown gracefully upon
55
-
application shutdown, see `OpenFeatureAPIManager`.
69
+
The initialized `OpenFeatureAPI` is managed via the dropwizard lifecycle and
70
+
will be shutdown gracefully upon application shutdown, see
71
+
`OpenFeatureAPIManager`.
56
72
57
73
### Healthcheck
58
74
59
-
By default the bundle registers a healthcheck on the state of the provider configured, this healthcheck can be further
60
-
configured via the `OpenFeatureHealthCheckConfiguration`.
75
+
By default the bundle registers a healthcheck on the state of the provider
76
+
configured, this healthcheck can be further configured via the
77
+
`OpenFeatureHealthCheckConfiguration`.
61
78
62
79
## Activating the bundle
63
80
64
81
Your Dropwizard application configuration class must implement `OpenFeatureBundleConfiguration`
65
82
66
83
### Configuring dropwizard-openfeature in the dropwizard config file
67
84
68
-
For a full overview see `OpenFeatureConfiguration`, `OpenFeatureHealthCheckConfiguration`, and `FlagdConfiguration` a
69
-
minimal configuration for flagd runnining locally on the port 8013 would look as follows.
85
+
For a full overview see `OpenFeatureConfiguration`,
86
+
`OpenFeatureHealthCheckConfiguration`, and the respective provider specific
87
+
configuration. A minimal configuration for flagd runnining locally on the port
88
+
8013 would look as follows.
70
89
71
90
```yaml
72
91
openfeature:
@@ -76,8 +95,8 @@ openfeature:
76
95
port: 8013
77
96
```
78
97
79
-
For the bundle to have access to the configuration, your application configuration needs to implement
80
-
`OpenFeatureBundleConfiguration`.
98
+
For the bundle to have access to the configuration, your application
99
+
configuration needs to implement `OpenFeatureBundleConfiguration`.
81
100
82
101
```java
83
102
public class Config extends Configuration implements OpenFeatureBundleConfiguration {
@@ -96,7 +115,8 @@ public class Config extends Configuration implements OpenFeatureBundleConfigurat
96
115
97
116
### Initialization
98
117
99
-
In your application's `initialize` method, call `bootstrap.addBundle(new OpenFeatureBundle())`:
118
+
In your application's `initialize` method, call `bootstrap.addBundle(new
119
+
OpenFeatureBundle())`:
100
120
101
121
```java
102
122
public class App extends Application<Config> {
@@ -115,9 +135,10 @@ public class App extends Application<Config> {
115
135
116
136
### Using the client
117
137
118
-
OpenFeature configures a global `OpenFeatureAPI` which grants access to a client, which can be injected as needed, it is
119
-
common practise to provide a domain as an identifier, this is however not required, unless multiple clients are to be
120
-
created.
138
+
OpenFeature configures a global `OpenFeatureAPI` which grants access to a
139
+
client, which can be injected as needed, it is common practise to provide a
140
+
domain as an identifier, this is however not required, unless multiple clients
141
+
are to be created.
121
142
122
143
```java
123
144
public class App extends Application<Config> {
@@ -144,8 +165,9 @@ public class App extends Application<Config> {
144
165
145
166
### Accessing the underlying feature provider
146
167
147
-
The bundle exposes access to the underlying feature provider. Useful for runtime configuration and introspection of the
148
-
provider. For example when using the `InMemoryProvider` flags can be updated at runtime for example for testing.
168
+
The bundle exposes access to the underlying feature provider. Useful for runtime
169
+
configuration and introspection of the provider. For example when using the
170
+
`InMemoryProvider`flags can be updated at runtime for example for testing.
149
171
150
172
```java
151
173
public class App extends Application<Config> {
@@ -177,3 +199,9 @@ public class App extends Application<Config> {
Copy file name to clipboardExpand all lines: src/test/java/io/github/sideshowcoder/dropwizard_openfeature/OpenFeatureBundleGoFeatureFlagProviderTest.java
0 commit comments