|
1 |
| -LaunchDarkly Server-side SDK for Java |
2 |
| -========================= |
| 1 | +# LaunchDarkly Server-side SDK for Java |
3 | 2 |
|
4 | 3 | [](https://circleci.com/gh/launchdarkly/java-server-sdk)
|
5 | 4 | [](http://javadoc.io/doc/com.launchdarkly/launchdarkly-java-server-sdk)
|
6 | 5 |
|
7 |
| -LaunchDarkly overview |
8 |
| -------------------------- |
| 6 | +## LaunchDarkly overview |
| 7 | + |
9 | 8 | [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!
|
10 | 9 |
|
11 | 10 | [](https://twitter.com/intent/follow?screen_name=launchdarkly)
|
12 | 11 |
|
13 |
| -Supported Java versions |
14 |
| ------------------------ |
| 12 | +## Supported Java versions |
15 | 13 |
|
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. |
17 | 15 |
|
18 |
| -Distributions |
19 |
| -------------- |
| 16 | +## Distributions |
20 | 17 |
|
21 | 18 | Three variants of the SDK jar are published to Maven:
|
22 | 19 |
|
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). |
25 | 22 | * The "thin" jar - add `<classifier>thin</classifier>` in Maven, or `:thin` in Gradle. This contains _only_ the SDK classes.
|
26 | 23 |
|
27 |
| -Getting started |
28 |
| ------------ |
| 24 | +## Getting started |
29 | 25 |
|
30 | 26 | 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.
|
31 | 27 |
|
32 |
| -Logging |
33 |
| -------- |
| 28 | +## Logging |
34 | 29 |
|
35 | 30 | 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.
|
36 | 31 |
|
37 | 32 | Be aware of two considerations when enabling the DEBUG log level:
|
38 | 33 | 1. Debug-level logs can be very verbose. It is not recommended that you turn on debug logging in high-volume environments.
|
39 | 34 | 1. Potentially sensitive information is logged including LaunchDarkly users created by you in your usage of this SDK.
|
40 | 35 |
|
41 |
| -Using flag data from a file |
42 |
| ---------------------------- |
| 36 | +## Using flag data from a file |
43 | 37 |
|
44 | 38 | 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.
|
45 | 39 |
|
46 |
| -DNS caching issues |
47 |
| ------------------- |
| 40 | +## DNS caching issues |
48 | 41 |
|
49 | 42 | 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.
|
50 | 43 |
|
51 | 44 | 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).
|
52 | 45 |
|
53 |
| -Learn more |
54 |
| ----------- |
| 46 | +## Learn more |
55 | 47 |
|
56 | 48 | 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/).
|
57 | 49 |
|
58 |
| -Testing |
59 |
| -------- |
| 50 | +## Testing |
60 | 51 |
|
61 | 52 | 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.
|
62 | 53 |
|
63 |
| -Contributing |
64 |
| ------------- |
| 54 | +## Contributing |
65 | 55 |
|
66 | 56 | 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.
|
67 | 57 |
|
68 |
| -About LaunchDarkly |
69 |
| ------------ |
| 58 | +## About LaunchDarkly |
70 | 59 |
|
71 | 60 | * 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:
|
72 | 61 | * 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