Skip to main content

Java Server SDK

Backend event tracking for the JVM: background batching, retries with backoff and jitter, automatic UUIDv7 idempotency keys. Zero runtime dependencies (Java 11+ HttpClient); Kotlin and Scala consume it idiomatically.

Usage

HoberClient client = HoberClient.builder(System.getenv("HOBER_SERVER_KEY")).build();

client.track(HoberEvent.builder("order.placed")
.externalId("user-483") // your user id — resolved by Hober
.property("order_id", "ord_921")
.property("total_cents", 12900)
.build());

client.identify("anon-9f2c", subscriberUuid);
client.close(); // flush before process exit (or use try-with-resources)

Create the server key under Settings → Server Keys. Full API semantics: Server-Side Event Tracking.

Behavior

  • Batching: a background worker ships batches of 100 (maxBatchSize) or every 5s (flushIntervalMillis); flush()/close() drain. The queue holds 10k events; beyond that track throws rather than growing unbounded.
  • Retries: 429 (honoring Retry-After) and 5xx retry with exponential backoff + jitter (4 retries default); other 4xx are permanent and surface through onError (default: dropped silently — tracking never takes your process down).
  • Idempotency: every event gets a UUIDv7 key unless you set one; supply your own (outbox row id, order id) to make cross-process retries safe.