Java control-socket client for EventDBX, mirroring the API exposed by eventdbxjs. The control plane is Cap’n Proto over TCP, encrypted with Noise (Noise_NNpsk0_25519_ChaChaPoly_SHA256) by default; a future flag will allow requesting plaintext for lab setups when the server is configured to permit noNoise.
- Library surface, models, and retry/configuration options match the Node client.
- Noise transport scaffold is in place, but Cap’n Proto bindings still need to be generated and wired. The
proto/control.capnpschema is vendored here for codegen. - The handshake schema now includes a
noNoiseflag in both hello/response; surface it inEventDbxConfigonce the bindings are wired if you need plaintext for testing against servers that allow it.
import com.eventdbx.client.*;
EventDbxConfig config = EventDbxConfig.builder()
.host("127.0.0.1")
.port(6363)
.token(System.getenv("EVENTDBX_TOKEN"))
.tenantId(System.getenv("EVENTDBX_TENANT_ID"))
.verbose(false)
// .noNoise(true) // opt into plaintext only when the server is configured to allow it
.build();
try (EventDbxClient client = new EventDbxClient(config)) {
client.connect(); // will throw until Cap'n Proto bindings are generated
client.list("person", PageOptions.builder().take(50).build());
client.create("person", "p-1", "person_registered", CreateAggregateOptions.builder()
.publishTarget("search-indexer") // publish targets require the plugin to be installed & running
.build());
client.apply("person", "p-1", "person_updated", AppendOptions.builder()
.note("email updated")
.publishTarget("analytics-engine:event-only")
.build());
client.events("person", "p-1", PageOptions.builder().build());
}- Schema:
proto/control.capnp(same as other EventDBX clients). - Transport: Noise with PSK derived from the control token (
SHA-256(token)), then Cap’n Proto messages framed with a 4-byte length prefix. - Required tooling:
capnpc-javato generate Java bindings from the schema. Once installed, runcapnp compile -ojava:src/main/java proto/control.capnpand wire the generated types intoNoiseControlClient.
- Maven coordinates are defined in
pom.xml(noise-java + capnproto runtime included). Install Maven locally to build:mvn test/mvn package.
- Generate Cap’n Proto bindings and implement the request/response mapping in
NoiseControlClient. - Port the retry/backoff logic from
eventdbxjsand add integration tests against a running EventDBX control socket (ControlIntegrationTestis scaffolded; enable viaEVENTDBX_INT_TEST=1and setEVENTDBX_TOKEN). - Add streaming/subscription support once exposed by the control protocol.