Quick Start Guide
All MVP.Express projects are currently in active development (pre-1.0.0) and should not be used in production environments. APIs may change without notice, and breaking changes are expected until each project reaches version 1.0.0. We welcome early adopters and contributors, but please use at your own risk.
In this tutorial, you will build a friendly ping/pong round trip using Myra Codec and Myra Transport.
Myra Codec turns a tiny schema into generated, zero-copy message classes, while Myra Transport moves those
bytes over the network with a lean, low-latency client/server flow. By the end, you will generate the code,
start a server, send a ping from a client, and receive a pong response.
Prerequisites
- Java 25+
- Git
- Internet access for Maven Central downloads
Step 1: Clone the examples repo
git clone https://github.com/mvp-express/examples.git
cd examples
Step 2: Review the schema
The tutorial uses a single message with one string field.
namespace: "express.mvp.myra.examples.pingpong.generated"
version: "1.0.0"
messages:
- name: "Payload"
fields:
- tag: 1
name: "value"
type: "string"
Step 3: Run the Gradle or Maven flow
Choose your build tool. Follow Step 3.a for Gradle or Step 3.b for Maven. Both flows produce the same ping/pong behavior.
Step 3.a: Gradle
Generate code, start the server, then run the client in another terminal.
cd myra-codec-transport-ping-pong-gradle
./gradlew codegen
# Terminal A
./gradlew runServer
# Terminal B
./gradlew runClient
Expected output:
Ping/pong server listening on /127.0.0.1:9000
Client connected
Received: ping
Connected, sending ping
Received: pong
Step 3.b: Maven
Use the Maven wrapper shipped with the example.
cd myra-codec-transport-ping-pong-maven
./mvnw -q \
-Dexec.mainClass=express.mvp.myra.codec.codegen.MyraCodegenCli \
-Dexec.args="--schema src/main/resources/schemas/ping_pong.myra.yml --output src/main/java --lockfile src/main/resources/locks/ping_pong.myra.lock" \
exec:java
# Terminal A
./mvnw -q -DskipTests \
-Dexec.mainClass=express.mvp.myra.examples.pingpong.PingPongServer \
-Dexec.jvmArgs="--enable-preview --enable-native-access=ALL-UNNAMED" \
compile exec:java
# Terminal B
./mvnw -q -DskipTests \
-Dexec.mainClass=express.mvp.myra.examples.pingpong.PingPongClient \
-Dexec.jvmArgs="--enable-preview --enable-native-access=ALL-UNNAMED" \
compile exec:java
Expected output:
Ping/pong server listening on /127.0.0.1:9000
Client connected
Received: ping
Connected, sending ping
Received: pong
What just happened?
- Codegen generated flyweights and builders under
src/main/java. - Server listened on
127.0.0.1:9000and replied withpong. - Client sent
pingand decoded the response without allocations.
Next steps
- Replace
Payloadwith your own schema and rerun codegen. - Switch the transport backend from NIO to io_uring in the server/client config.
- Explore the codec-only examples for richer schemas.