Skip to content
etcd java client
Java Shell
Branch: master
Clone or download
dependabot-preview and lburgazzoli Build(deps): bump netty-tcnative-boringssl-static
Bumps [netty-tcnative-boringssl-static](https://github.com/netty/netty-tcnative) from 2.0.27.Final to 2.0.28.Final.
- [Release notes](https://github.com/netty/netty-tcnative/releases)
- [Commits](netty/netty-tcnative@netty-tcnative-parent-2.0.27.Final...netty-tcnative-parent-2.0.28.Final)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Latest commit 8a798a8 Dec 5, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.mvn/wrapper chore(build): upgrade mvnw to target maven 3.5.3 Apr 18, 2018
docs Get Query for Retrieving all Keys #266 May 30, 2018
etc chore(travis): update java version Oct 31, 2019
jetcd-all [maven-release-plugin] prepare for next development iteration Oct 22, 2019
jetcd-common [maven-release-plugin] prepare for next development iteration Oct 22, 2019
jetcd-core core: added support for min/max create/mod revision filters on range … Nov 15, 2019
jetcd-examples Build(deps): bump maven-jar-plugin from 3.1.2 to 3.2.0 Nov 6, 2019
jetcd-extensions [maven-release-plugin] prepare for next development iteration Oct 22, 2019
jetcd-launcher-maven-plugin-test [maven-release-plugin] prepare for next development iteration Oct 22, 2019
jetcd-launcher-maven-plugin Build(deps): bump maven-core from 3.6.2 to 3.6.3 Dec 2, 2019
jetcd-launcher [maven-release-plugin] prepare for next development iteration Oct 22, 2019
jetcd-osgi [maven-release-plugin] prepare for next development iteration Oct 22, 2019
jetcd-resolver-dns-srv [maven-release-plugin] prepare for next development iteration Oct 22, 2019
jetcd-resolver [maven-release-plugin] prepare for next development iteration Oct 22, 2019
.gitignore chore(uberjar): remove dependencies shaded in jetcd-all from the tran… Sep 10, 2019
.travis.yml chore(travis): update java version Oct 31, 2019
CHANGELOG.md add initial Change Log (#440) Nov 9, 2018
CONTRIBUTING.md all: update copyrights and configure license plugin Mar 28, 2019
DCO update CoC and legalese Jan 4, 2018
LICENSE Initial commit Jul 20, 2016
MAINTAINERS doc: add MAINTAINERS Jul 14, 2017
NOTICE update CoC and legalese Jan 4, 2018
README.md Fix EtcdClusterResource invocation in README Nov 25, 2019
code-of-conduct.md update CoC and legalese Jan 4, 2018
mvnw chore(build): upgrade mvnw to target maven 3.5.3 Apr 18, 2018
mvnw.cmd chore(build): upgrade mvnw to target maven 3.5.3 Apr 18, 2018
pom.xml Build(deps): bump netty-tcnative-boringssl-static Dec 5, 2019

README.md

jetcd - A Java Client for etcd

Build Status License Maven Central GitHub release Javadocs

jetcd is the official java client for etcd v3.

Note: jetcd is work-in-progress and may break backward compatibility.

Java Versions

Java 8 or above is required.

Download

Maven

<dependency>
  <groupId>io.etcd</groupId>
  <artifactId>jetcd-core</artifactId>
  <version>${jetcd-version}</version>
</dependency>

Development snapshots are available in Sonatypes's snapshot repository.

Gradle

dependencies {
    compile "io.etcd:jetcd-core:$jetcd-version"
}

Usage

// create client
Client client = Client.builder().endpoints("http://localhost:2379").build();
KV kvClient = client.getKVClient();

ByteSequence key = ByteSequence.from("test_key".getBytes());
ByteSequence value = ByteSequence.from("test_value".getBytes());

// put the key-value
kvClient.put(key, value).get();

// get the CompletableFuture
CompletableFuture<GetResponse> getFuture = kvClient.get(key);

// get the value from CompletableFuture
GetResponse response = getFuture.get();

// delete the key
kvClient.delete(key).get();

For full etcd v3 API, plesase refer to API_Reference.

Examples

The examples are standalone projects that show usage of jetcd.

Launcher

The io.etcd:jetcd-launcher offers a convenient utility to programmatically start & stop an isolated etcd server. This can be very useful e.g. for integration testing, like so:

@Rule public final EtcdClusterResource etcd = new EtcdClusterResource("test-etcd", 1);
Client client = Client.builder().endpoints(etcd.getClientEndpoints()).build();

This launcher uses the Testcontainers framework. For more info and prerequisites visit testcontainers.org.

Versioning

The project follows Semantic Versioning.

The current major version is zero (0.y.z). Anything may change at any time. The public API should not be considered stable.

Running tests

The project is tested against a three node etcd setup started with the Launcher (above) :

$ mvn test
...

[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
[WARNING] Tests run: 104, Failures: 0, Errors: 0, Skipped: 3, Time elapsed: 31.308 s - in TestSuite
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 104, Failures: 0, Errors: 0, Skipped: 3
...
[INFO] Reactor Summary:
[INFO]
[INFO] jetcd .............................................. SUCCESS [  0.010 s]
[INFO] jetcd-core ......................................... SUCCESS [ 55.480 s]
[INFO] jetcd-discovery-dns-srv ............................ SUCCESS [  3.225 s]
[INFO] jetcd-watch-example ................................ SUCCESS [  0.291 s]
[INFO] jetcd-simple-ctl ................................... SUCCESS [  0.028 s]
[INFO] jetcd-examples ..................................... SUCCESS [  0.000 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 59.929 s
[INFO] Finished at: 2018-02-13T12:51:13-08:00
[INFO] Final Memory: 84M/443M

Contact

  • Mailing list: etcd-dev
  • IRC: #etcd on freenode.org

Contributing

See CONTRIBUTING for details on submitting patches and the contribution workflow.

Reporting bugs

See reporting bugs for details about reporting any issues.

License

jetcd is under the Apache 2.0 license. See the LICENSE file for details.

You can’t perform that action at this time.