Overview
The telemetry demo encodes a sensor payload with enum health state, repeated latency measurements, and optional note and payload fields. It then decodes the message with flyweights and prints the values.
Clone and run
-
Install Java 25 and Git, then confirm the toolchain.
java --version -
Clone the examples repository.
git clone https://github.com/mvp-express/examples.git -
Move into the telemetry example folder.
cd examples/myra-codec-telemetry -
Generate sources and the lock file.
./gradlew codegen -
Run the demo app.
./gradlew run
If you are on Windows, use gradlew.bat instead of ./gradlew.
Concepts highlighted
- Enum decoding with
Healthand compact numeric IDs. - Repeated scalar arrays for latency samples.
- Optional note and payload fields with presence checks.
- Payload access with
Utf8Viewand MemorySegment copy. - Builder and flyweight encode/decode with pooled buffers.
Files to explore
src/main/resources/schemas/telemetry.myra.ymlsrc/main/java/express/mvp/myra/codec/examples/TelemetryExampleApp.java