Examples / Myra Codec

Telemetry Stream

myra-codec-telemetry

A compact telemetry message with enums, repeated latencies, and optional note and payload fields.

Codec Gradle Java 25 View source

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

  1. Install Java 25 and Git, then confirm the toolchain.

    java --version
  2. Clone the examples repository.

    git clone https://github.com/mvp-express/examples.git
  3. Move into the telemetry example folder.

    cd examples/myra-codec-telemetry
  4. Generate sources and the lock file.

    ./gradlew codegen
  5. Run the demo app.

    ./gradlew run

If you are on Windows, use gradlew.bat instead of ./gradlew.

Concepts highlighted

  • Enum decoding with Health and compact numeric IDs.
  • Repeated scalar arrays for latency samples.
  • Optional note and payload fields with presence checks.
  • Payload access with Utf8View and MemorySegment copy.
  • Builder and flyweight encode/decode with pooled buffers.

Files to explore

  • src/main/resources/schemas/telemetry.myra.yml
  • src/main/java/express/mvp/myra/codec/examples/TelemetryExampleApp.java

At a glance

  • Type: Myra Codec
  • Build: Gradle
  • Main: TelemetryExampleApp
  • Schema: telemetry.myra.yml
  • Output: Console logs
Open on GitHub

Learn more

Explore how flyweights keep decode paths allocation free.

Myra Codec Docs