etcd-recipes is a Kotlin/Java/JVM client library for etcd v3, a distributed, reliable key-value store. It attempts to provide the same kind of support for etcd that Curator does for ZooKeeper.
The repo includes Java and Kotlin examples.
connectToEtcd(urls) { client ->
client.putValue("test_key", "test_value")
sleep(5.seconds)
client.delete("test_key")
}
etcd-recipes is built on top of jetcd, which works with etcd v3.
etcd-recipies is written in Kotlin, but is usable by Java and any other JVM clients.
Jars are available at jitpack.io.
# Add kotlinx and jitpack.io to repositories
repositories {
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
maven { url 'https://jitpack.io' }
}
dependencies {
implementation "com.github.pambrose.etcd-recipes:etcd-recipes:0.9.21"
}
<repositories>
<repository>
<id>kotlinx</id>
<name>kotlinkx Releases</name>
<url>https://kotlin.bintray.com/kotlinx</url>
</repository>
<repository>
<id>jitpack.io</id>
<name>jitpack.io Releases</name>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.pambrose.etcd-recipes</groupId>
<artifactId>etcd-recipes</artifactId>
<version>0.9.21</version>
</dependency>
</dependencies>