GuidesThin SDK
Java Thin SDK
Maven coordinates, install steps, and Sidecar Session / TargetService usage for pole-client-java.
The Java Thin SDK (pole-client-java) targets Java 17+ and opens a Sidecar Session over gRPC on Unix Domain Sockets.
Official package
| Item | Value |
|---|---|
| Repository | github.com/lattice-hub/pole-client-java |
| Maven coordinates | io.github.lattice-hub:pole-client-java |
| Current version | 0.1.0-SNAPSHOT (Central Portal Snapshots; not a release) |
| Requirements | Java 17+; Maven 3.8+; Unix-like with JDK UDS; Windows is out of v1 scope |
Consumers need the Central Portal Snapshots repository:
<repositories>
<repository>
<id>central-portal-snapshots</id>
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>io.github.lattice-hub</groupId>
<artifactId>pole-client-java</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>Minimal usage
Default UDS: /var/run/pole/sidecar/bootstrap.sock, overridable with POLE_SIDECAR_SOCKET.
import io.github.latticehub.client.SidecarBootstrapClient;
import io.github.latticehub.client.SidecarProtocol;
import io.github.latticehub.client.TargetService;
import io.github.latticehub.client.TargetServiceMetadata;
import java.net.InetSocketAddress;
import java.util.Map;
try (SidecarBootstrapClient sidecar = SidecarBootstrapClient.connect()) {
InetSocketAddress grpcAddress = sidecar.listenerAddress(SidecarProtocol.GRPC);
TargetService target = TargetService.builder()
.namespace("default")
.service("orders")
.build();
Map<String, String> metadata = TargetServiceMetadata.encode(target);
// Point your business client at grpcAddress (or the matching protocol listener)
// and inject metadata.
}Tune initialization timeout and backoff as needed:
SidecarBootstrapClient sidecar = SidecarBootstrapClient.builder()
.initializationTimeout(Duration.ofSeconds(20))
.initialBackoff(Duration.ofMillis(100))
.maxBackoff(Duration.ofSeconds(2))
.connect();Metadata
Canonical keys:
latticehub-target-namespace
latticehub-target-serviceTargetServiceMetadata.encode removes caller-supplied same-name internal fields case-insensitively before writing authoritative values.
Boundary
- No Spring / Dubbo / Thrift / HTTP client adapters in the core package
- End-to-end compatibility is still evolving—see the Thin SDK overview