Skip to content

docs(bindings): a runnable Java example, run in CI - #591

Open
aditipolkam wants to merge 1 commit into
mainfrom
docs/java-example
Open

aditipolkam wants to merge 1 commit into
mainfrom
docs/java-example

Conversation

@aditipolkam

@aditipolkam aditipolkam commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds examples/java-app, a runnable example for the Java binding merged in #582.

Two devices, Alice and Bob, in one JVM pair, establish an end-to-end encrypted session and exchange two messages. The only simulated part is the network: a short loop moves bytes between the two engines (internetGetNextMessage to internetMessageReceived), which is what a real transport does. The pairing, the MLS session and the encryption are the engine's own.

  • Shows a full ProtocolConfig (the generated record has no defaults, J2), the engine's built-in file stores, answering the pairing events, and treating SessionNotReady as "not yet" while the key package is in flight.
  • settings.gradle.kts depends on the published coordinate com.offlineprotocol:offline-protocol-java and substitutes the checkout's binding through a composite build, so it runs against this source; in a real project that block is dropped.
  • The Java Binding CI job runs it on Linux, macOS and Windows, so it cannot drift from the binding.
  • Linked from bindings/java/README.md.

Type of change

  • docs: documentation only (an example, plus one CI step that runs it)

Checks run locally

  • gradle run in examples/java-app on this branch (JDK 26, Gradle 9.3.1): pairs, and both messages arrive.
  • scripts/tests/test-generate-bindings.sh: 63 guards pass.

Not run locally: the new CI step on macOS and Windows.

Two devices in one JVM pair, establish an encrypted session and exchange
messages, with the app doing only what a transport does: moving bytes
between engines. It depends on the published coordinate and substitutes
the checkout's binding through a composite build, so it cannot drift
from the code it documents.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant