A runtime for the cluster. An SDK for the app.
Application SDK for the local Clusdr daemon. This package does not join the cluster.
your process ──► clusdr daemon on this host ──► the rest of the cluster
Not a database, queue, or Kubernetes. Wire API is v1alpha1. TLS is on by default. Blocking client on Java 17+.
<dependency>
<groupId>io.clusdr</groupId>
<artifactId>clusdr</artifactId>
<version>0.2.0</version>
</dependency>Same version train as the daemon. A running daemon on this host is required:
curl -fsSL https://clusdr.io/install.sh | shLinux amd64/arm64, or Docker Hub durguto/clusdr (GHCR: ghcr.io/clusdr/clusdr). Then clusdr init and clusdr start --bootstrap. Guide: first member.
Clusdr.local() dials CLUSDR_GRPC_ADDR or 127.0.0.1:7947, waits on Health, then you own the connection.
try (Cluster c = Clusdr.local()) {
List<Member> members = c.members();
Member leader = c.leader();
c.publish("deployment", Map.of("sha", "abc"));
Lock lk = c.lock("scheduler", Duration.ofSeconds(15));
c.unlock("scheduler");
for (Event event : c.watch()) {
// member.join, leader.changed, custom.deployment, …
break;
}
}dial is for tests and operators. Apps use local().
One Cluster is safe for concurrent unary calls. Same connection = same holder (unlock is process-wide for that name). Several watch() loops on one client are fine.
ttl is a Duration. close() (and try-with-resources) stops Watch, unlocks, and revokes what this process still holds. Failures throw ClusdrException.
Full surface: Java SDK. Runnable copies (Go, Python, Rust, TypeScript, and Java): examples.
On unless insecure(true) or CLUSDR_TLS=disabled. PEMs (ca.crt, node.crt, node.key) come from dataDir, CLUSDR_DATA_DIR, or ~/.clusdr. Missing files are an error; this client does not skip-verify.
- Join, promote, or configure the cluster (CLI)
- Talking to a remote node's Runtime API as the normal path — put a daemon on that host
- Docs: clusdr.io · Java SDK · from your app
- Daemon: github.com/clusdr/clusdr
- This repo: github.com/clusdr/clusdr-java
Apache-2.0. Contributor checkout: CONTRIBUTING.md.