Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.

Commit 9812c3a

Browse files
authored
prepare 5.0.0-rc1 release (#191)
1 parent 4125970 commit 9812c3a

File tree

237 files changed

+12363
-19119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

237 files changed

+12363
-19119
lines changed

.circleci/config.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ jobs:
5454
type: string
5555
docker:
5656
- image: <<parameters.docker-image>>
57-
- image: redis
5857
steps:
5958
- checkout
6059
- run: cp gradle.properties.example gradle.properties
@@ -85,18 +84,6 @@ jobs:
8584
$ProgressPreference = "SilentlyContinue" # prevents console errors from CircleCI host
8685
iwr -outf openjdk.msi https://developers.redhat.com/download-manager/file/java-11-openjdk-11.0.5.10-2.windows.redhat.x86_64.msi
8786
Start-Process msiexec.exe -Wait -ArgumentList '/I openjdk.msi /quiet'
88-
- run:
89-
name: start Redis
90-
command: |
91-
$ProgressPreference = "SilentlyContinue"
92-
iwr -outf redis.zip https://github.com/MicrosoftArchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.zip
93-
mkdir redis
94-
Expand-Archive -Path redis.zip -DestinationPath redis
95-
cd redis
96-
.\redis-server --service-install
97-
.\redis-server --service-start
98-
Start-Sleep -s 5
99-
.\redis-cli ping
10087
- run:
10188
name: build and test
10289
command: |

.ldrelease/config.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ publications:
1010

1111
template:
1212
name: gradle
13-
env:
14-
LD_SKIP_DATABASE_TESTS: 1
1513

1614
documentation:
1715
githubPages: true

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,38 @@
22

33
All notable changes to the LaunchDarkly Java SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
44

5+
## [5.0.0-rc1] - 2020-04-29
6+
This beta release is being made available for testing and user feedback, due to the large number of changes from Java SDK 4.x. Features are still subject to change in the final 5.0.0 release. Until the final release, the beta source code will be on the [5.x branch](https://github.com/launchdarkly/java-server-sdk/tree/5.x). Javadocs can be found on [javadoc.io](https://javadoc.io/doc/com.launchdarkly/launchdarkly-server-sdk/5.0.0-rc1/index.html).
7+
8+
This is a major rewrite that introduces a cleaner API design, adds new features, and makes the SDK code easier to maintain and extend. See the [Java 4.x to 5.0 migration guide](https://docs.launchdarkly.com/sdk/server-side/java/migration-4-to-5) for an in-depth look at the changes in this version; the following is a summary.
9+
10+
### Added:
11+
- You can tell the SDK to notify you whenever a feature flag's configuration has changed in any way, using `FlagChangeListener` and `LDClient.registerFlagChangeListener()`.
12+
- Or, you can tell the SDK to notify you only if the _value_ of a flag for some particular `LDUser` has changed, using `FlagValueChangeListener` and `Components.flagValueMonitoringListener()`.
13+
- You can monitor the status of a persistent data store (for instance, to get caching statistics, or to be notified if the store's availability changes due to a database outage) with `LDClient.getDataStoreStatusProvider()`.
14+
- The `UserAttribute` class provides a less error-prone way to refer to user attribute names in configuration, and can also be used to get an arbitrary attribute from a user.
15+
- The `LDGson` and `LDJackson` classes allow SDK classes like LDUser to be easily converted to or from JSON using the popular Gson and Jackson frameworks.
16+
17+
### Changed:
18+
- The minimum supported Java version is now 8.
19+
- Package names have changed: the main SDK classes are now in `com.launchdarkly.sdk` and `com.launchdarkly.sdk.server`.
20+
- Many rarely-used classes and interfaces have been moved out of the main SDK package into `com.launchdarkly.sdk.server.integrations` and `com.launchdarkly.sdk.server.interfaces`.
21+
- The type `java.time.Duration` is now used for configuration properties that represent an amount of time, instead of using a number of milliseconds or seconds.
22+
- When using a persistent data store such as Redis, if there is a database outage, the SDK will wait until the end of the outage and then restart the stream connection to ensure that it has the latest data. Previously, it would try to restart the connection immediately and continue restarting if the database was still not available, causing unnecessary overhead.
23+
- `EvaluationDetail.getVariationIndex()` now returns `int` instead of `Integer`.
24+
- `EvaluationReason` is now a single concrete class rather than an abstract base class.
25+
- The SDK no longer exposes a Gson dependency or any Gson types.
26+
- Third-party libraries like Gson, Guava, and OkHttp that are used internally by the SDK have been updated to newer versions since Java 7 compatibility is no longer required.
27+
- The component interfaces `FeatureStore` and UpdateProcessor have been renamed to `DataStore` and `DataSource`. The factory interfaces for these components now receive SDK configuration options in a different way that does not expose other components' configurations to each other.
28+
- The `PersistentDataStore` interface for creating your own database integrations has been simplified by moving all of the serialization and caching logic into the main SDK code.
29+
30+
### Removed:
31+
- All types and methods that were deprecated as of Java SDK 4.13.0 have been removed. This includes many `LDConfig.Builder()` methods, which have been replaced by the modular configuration syntax that was already added in the 4.12.0 and 4.13.0 releases. See the [migration guide](https://docs.launchdarkly.com/sdk/server-side/java/migration-4-to-5) for details on how to update your configuration code if you were using the older syntax.
32+
- The Redis integration is no longer built into the main SDK library (see below).
33+
- The deprecated New Relic integration has been removed.
34+
35+
If you want to test this release and you are using Consul, DynamoDB, or Redis as a persistent data store, you will also need to update to version 2.0.0-rc1 of the [Consul integration](https://github.com/launchdarkly/java-server-sdk-consul/tree/2.x), 3.0.0-rc1 of the [DynamoDB integration](https://github.com/launchdarkly/java-server-sdk-dynamodb/tree/3.x), or 1.0.0-rc1 of the [Redis integration](http://github.com/launchdarkly/java-server-sdk-redis) (previously the Redis integration was built in; now it is a separate module).
36+
537
## [4.13.0] - 2020-04-21
638
### Added:
739
- The new methods `Components.httpConfiguration()` and `LDConfig.Builder.http()`, and the new class `HttpConfigurationBuilder`, provide a subcomponent configuration model that groups together HTTP-related options such as `connectTimeoutMillis` and `proxyHost` - similar to how `Components.streamingDataSource()` works for streaming-related options or `Components.sendEvents()` for event-related options. The individual `LDConfig.Builder` methods for those options will still work, but are deprecated and will be removed in version 5.0.

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ We encourage pull requests and other contributions from the community. Before su
1515

1616
### Prerequisites
1717

18-
The SDK builds with [Gradle](https://gradle.org/) and should be built against Java 7.
19-
18+
The SDK builds with [Gradle](https://gradle.org/) and should be built against Java 8.
19+
20+
Many basic classes are implemented in the module `launchdarkly-java-sdk-common`, whose source code is in the [`launchdarkly/java-sdk-common`](https://github.com/launchdarkly/java-sdk-common) repository; this is so the common code can be shared with the LaunchDarkly Android SDK. By design, the LaunchDarkly Java SDK distribution does not expose a dependency on that module; instead, its classes and Javadoc content are embedded in the SDK jars.
21+
2022
### Building
2123

2224
To build the SDK without running any tests:
@@ -40,5 +42,3 @@ To build the SDK and run all unit tests:
4042
```
4143
./gradlew test
4244
```
43-
44-
By default, the full unit test suite includes live tests of the Redis integration. Those tests expect you to have Redis running locally. To skip them, set the environment variable `LD_SKIP_DATABASE_TESTS=1` before running the tests.

README.md

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,61 @@
1-
LaunchDarkly Server-side SDK for Java
2-
=========================
1+
# LaunchDarkly Server-side SDK for Java
32

43
[![Circle CI](https://circleci.com/gh/launchdarkly/java-server-sdk.svg?style=shield)](https://circleci.com/gh/launchdarkly/java-server-sdk)
54
[![Javadocs](http://javadoc.io/badge/com.launchdarkly/launchdarkly-java-server-sdk.svg)](http://javadoc.io/doc/com.launchdarkly/launchdarkly-java-server-sdk)
65

7-
LaunchDarkly overview
8-
-------------------------
6+
## LaunchDarkly overview
7+
98
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/docs/getting-started) using LaunchDarkly today!
109

1110
[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)
1211

13-
Supported Java versions
14-
-----------------------
12+
## Supported Java versions
1513

16-
This version of the LaunchDarkly SDK works with Java 7 and above.
14+
This version of the LaunchDarkly SDK works with Java 8 and above.
1715

18-
Distributions
19-
-------------
16+
## Distributions
2017

2118
Three variants of the SDK jar are published to Maven:
2219

23-
* The default uberjar - this is accessible as `com.launchdarkly:launchdarkly-java-server-sdk:jar` and is the dependency used in the "[Getting started](https://docs.launchdarkly.com/docs/java-sdk-reference#section-getting-started)" section of the SDK reference guide as well as in the [`hello-java`](https://github.com/launchdarkly/hello-java) sample app. This variant contains the SDK classes, and all of the SDK's dependencies except for Gson and SLF4J, which must be provided by the host application. The bundled dependencies have shaded package names (and are not exported in OSGi), so they will not interfere with any other versions of the same packages.
24-
* The extended uberjar - add `<classifier>all</classifier>` in Maven, or `:all` in Gradle. This is the same as the default uberjar except that Gson and SLF4J are also bundled, without shading (and are exported in OSGi).
20+
* The default uberjar - this is accessible as `com.launchdarkly:launchdarkly-java-server-sdk:jar` and is the dependency used in the "[Getting started](https://docs.launchdarkly.com/docs/java-sdk-reference#section-getting-started)" section of the SDK reference guide as well as in the [`hello-java`](https://github.com/launchdarkly/hello-java) sample app. This variant contains the SDK classes, and all of the SDK's dependencies except for SLF4J, which must be provided by the host application. The bundled dependencies have shaded package names (and are not exported in OSGi), so they will not interfere with any other versions of the same packages.
21+
* The extended uberjar - add `<classifier>all</classifier>` in Maven, or `:all` in Gradle. This is the same as the default uberjar except that SLF4J is also bundled, without shading (and is exported in OSGi).
2522
* The "thin" jar - add `<classifier>thin</classifier>` in Maven, or `:thin` in Gradle. This contains _only_ the SDK classes.
2623

27-
Getting started
28-
-----------
24+
## Getting started
2925

3026
Refer to the [SDK reference guide](https://docs.launchdarkly.com/docs/java-sdk-reference#section-getting-started) for instructions on getting started with using the SDK.
3127

32-
Logging
33-
-------
28+
## Logging
3429

3530
The LaunchDarkly SDK uses [SLF4J](https://www.slf4j.org/). All loggers are namespaced under `com.launchdarkly`. For an example configuration check out the [hello-java](https://github.com/launchdarkly/hello-java) project.
3631

3732
Be aware of two considerations when enabling the DEBUG log level:
3833
1. Debug-level logs can be very verbose. It is not recommended that you turn on debug logging in high-volume environments.
3934
1. Potentially sensitive information is logged including LaunchDarkly users created by you in your usage of this SDK.
4035

41-
Using flag data from a file
42-
---------------------------
36+
## Using flag data from a file
4337

4438
For testing purposes, the SDK can be made to read feature flag state from a file or files instead of connecting to LaunchDarkly. See <a href="http://javadoc.io/page/com.launchdarkly/launchdarkly-java-server-sdk/latest/com/launchdarkly/client/files/FileComponents.html">FileComponents</a> for more details.
4539

46-
DNS caching issues
47-
------------------
40+
## DNS caching issues
4841

4942
LaunchDarkly servers operate in a load-balancing framework which may cause their IP addresses to change. This could result in the SDK failing to connect to LaunchDarkly if an old IP address is still in your system's DNS cache.
5043

5144
Unlike some other languages, in Java the DNS caching behavior is controlled by the Java virtual machine rather than the operating system. The default behavior varies depending on whether there is a [security manager](https://docs.oracle.com/javase/tutorial/essential/environment/security.html): if there is, IP addresses will _never_ expire. In that case, we recommend that you set the security property `networkaddress.cache.ttl`, as described [here](https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-jvm-ttl.html), to a number of seconds such as 30 or 60 (a lower value will reduce the chance of intermittent failures, but will slightly reduce networking performance).
5245

53-
Learn more
54-
----------
46+
## Learn more
5547

5648
Check out our [documentation](https://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/docs/java-sdk-reference) or our [code-generated API documentation](https://launchdarkly.github.io/java-server-sdk/).
5749

58-
Testing
59-
-------
50+
## Testing
6051

6152
We run integration tests for all our SDKs using a centralized test harness. This approach gives us the ability to test for consistency across SDKs, as well as test networking behavior in a long-running application. These tests cover each method in the SDK, and verify that event sending, flag evaluation, stream reconnection, and other aspects of the SDK all behave correctly.
6253

63-
Contributing
64-
------------
54+
## Contributing
6555

6656
We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this SDK.
6757

68-
About LaunchDarkly
69-
-----------
58+
## About LaunchDarkly
7059

7160
* 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:
7261
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.

0 commit comments

Comments
 (0)