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
The source code for this library is [here](https://github.com/launchdarkly/java-client-dynamodb). We encourage pull-requests and other contributions from the community. Since this library is meant to be used in conjunction with the LaunchDarkly Java SDK, you may want to look at the [Java SDK source code](https://github.com/launchdarkly/java-client) and our [SDK contributor's guide](http://docs.launchdarkly.com/docs/sdk-contributors-guide).
4
+
5
+
## Submitting bug reports and feature requests
6
+
7
+
The LaunchDarkly SDK team monitors the [issue tracker](https://github.com/launchdarkly/java-server-sdk-dynamodb/issues) in this repository. Bug reports and feature requests specific to this project should be filed in the issue tracker. The SDK team will respond to all newly filed issues within two business days.
8
+
9
+
## Submitting pull requests
10
+
11
+
We encourage pull requests and other contributions from the community. Before submitting pull requests, ensure that all temporary or unintended code is removed. Don't worry about adding reviewers to the pull request; the LaunchDarkly SDK team will add themselves. The SDK team will acknowledge all pull requests within two business days.
12
+
13
+
## Build instructions
14
+
15
+
### Prerequisites
16
+
17
+
The library builds with [Gradle](https://gradle.org/) and should be built against Java 8.
18
+
19
+
### Building
20
+
21
+
To build the library without running any tests:
22
+
```
23
+
./gradlew jar
24
+
```
25
+
26
+
If you wish to clean your working directory between builds, you can clean it by running:
27
+
```
28
+
./gradlew clean
29
+
```
30
+
31
+
If you wish to use an interim build in another Maven/Gradle project such as [hello-java](https://github.com/launchdarkly/hello-java), you will likely want to publish the artifact to your local Maven repository so that your other project can access it.
32
+
```
33
+
./gradlew publishToMavenLocal
34
+
```
35
+
36
+
### Testing
37
+
38
+
To build the library and run all unit tests:
39
+
```
40
+
./gradlew test
41
+
```
42
+
43
+
The tests expect you to have DynamoDB running locally. The simplest way to do that is with Docker: `docker run -p 8000:8000 amazon/dynamodb-local`
Copy file name to clipboardExpand all lines: README.md
+20-25Lines changed: 20 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,9 @@
5
5
6
6
This library provides a DynamoDB-backed persistence mechanism (data store) for the [LaunchDarkly Java SDK](https://github.com/launchdarkly/java-server-sdk), replacing the default in-memory data store.
7
7
8
-
This version of the library is for use with LaunchDarkly Java SDK versions greater than or equal to 4.12.0 and less than 5.0; for Java SDK 5.0 and above, the minimum version of this library is 3.0. It requires at least version 2.1 of the AWS SDK for Java. The minimum Java version is 8 (because that is the minimum Java version of the AWS SDK 2.x). If you need to use Java 7, or if you are already using AWS SDK 1.x for some other purpose, you can use the 1.x releases of this library (which are developed on the "aws-v1" branch of the repository).
8
+
This version of the library requires at least version 5.0.0 of the LaunchDarkly Java SDK, and at least version 2.1 of the AWS SDK for Java. The minimum Java version is 8. For Java SDK 4.x, use the latest 2.x version of this library.
9
+
10
+
If you need to use Java 7, or if you are already using AWS SDK 1.x for some other purpose, you can use the 1.x releases of this library (which are developed on the "aws-v1" branch of the repository).
9
11
10
12
See the [API documentation](https://launchdarkly.github.io/java-server-sdk-dynamodb) for details on classes and methods.
11
13
@@ -17,12 +19,12 @@ This assumes that you have already installed the LaunchDarkly Java SDK.
17
19
18
20
1. In DynamoDB, create a table which has the following schema: a partition key called "namespace" and a sort key called "key", both with a string type. The LaunchDarkly library does not create the table automatically, because it has no way of knowing what additional properties (such as permissions and throughput) you would want it to have.
19
21
20
-
2. Add this library to your project:
22
+
2. Add this library to your project (updating the version number to use the [latest release](https://github.com/launchdarkly/java-server-sdk-dynamodb/releases)):
3. If you do not already have the AWS SDK in your project, add the DynamoDB part of it. (This needs to be added separately, rather than being included in the LaunchDarkly jar, because AWS classes are exposed in the public interface.)
@@ -35,44 +37,37 @@ This assumes that you have already installed the LaunchDarkly Java SDK.
35
37
36
38
4. Import the LaunchDarkly package and the package for this library:
LDClient client = new LDClient("YOUR SDK KEY", config);
50
52
51
53
By default, the DynamoDB client will try to get your AWS credentials and region name from environment variables and/or local configuration files, as described in the AWS SDK documentation. There are methods in `DynamoDbDataStoreBuilder` for changing the configuration options. Alternatively, if you already have a fully configured DynamoDB client object, you can tell LaunchDarkly to use that:
To reduce traffic to DynamoDB, there is an optional in-memory cache that retains the last known data for a configurable amount of time. This is on by default; to turn it off (and guarantee that the latest feature flag data will always be retrieved from DynamoDB for every flag evaluation), configure the store as follows:
59
-
60
-
By default, for any persistent data store, the Java SDK uses an in-memory cache to reduce traffic to the database; this retains the last known data for a configurable amount of time. To change the caching behavior or disable caching, use the `PersistentDataStoreBuilder` methods:
61
-
62
-
LDConfig configWithLongerCacheTtl = new LDConfig.Builder()
The LaunchDarkly SDK has a standard caching mechanism for any persistent data store, to reduce database traffic. This is configured through the SDK's `PersistentDataStoreBuilder` class as described the SDK documentation. For instance, to specify a cache TTL of 5 minutes:
67
62
68
-
LDConfig configWithNoCaching = new LDConfig.Builder()
For other ways to control the behavior of the cache, see `PersistentDataStoreBuilder` in the Java SDK.
75
-
76
71
## About LaunchDarkly
77
72
78
73
* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
0 commit comments