A Quarkus project to illustrate how JSON Schema, Avro and Protobuf can be used for serialization and deserialization of messages with Kafka.
This project uses Quarkus, the Supersonic Subatomic Java Framework.
The project will use a scheduler to publish message to a Kafka topic using three types of schema; JSON Schema, Avro and Protobuf.
You can run your application in dev mode that enables live coding using:
./gradlew quarkusDev
Note: the application uses TestContainers to start dependent services:
- A Kafka broker
- An Apicurio schema registry
The application will be started in prod mode using docker compose
. For this to work an image
is required containing the Quarkus
application. This can be built (from the project root directory) using:
docker build -f src/main/docker/Dockerfile.jvm -t quarkus/kafka-serialization-jvm .
See the Dockerfile in the src/main/docker
directory for more info.
To run the application in prod mode (after build) use:
docker compose up -d
Note: The Docker Compose file will start the dependent services:
- Confluent Kafka
- An Apicurio schema registry