From 967435bce9fe4c9089f2d162512c62a44af6cfb1 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 11 Oct 2021 21:53:26 +0200 Subject: [PATCH] WIP --- pom.xml | 27 +++++++++++++++++++++++++++ src/main/resources/avro/user.avsc | 23 +++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/main/resources/avro/user.avsc diff --git a/pom.xml b/pom.xml index 56a2b76..e090dba 100644 --- a/pom.xml +++ b/pom.xml @@ -14,6 +14,7 @@ Wordcount-Query Query stream-processor of the multi-user wordcount-example + 1.10.2 0.33.0 11 2.8.0 @@ -31,6 +32,11 @@ org.apache.kafka kafka-streams + + org.apache.avro + avro + ${avro.version} + org.springframework.boot @@ -81,6 +87,27 @@ + + org.apache.avro + avro-maven-plugin + ${avro.version} + + + generate-sources + + schema + + + ${project.basedir}/src/main/resources/avro + ${project.basedir}/target/generated-sources + PRIVATE + + *.avsc + + + + + diff --git a/src/main/resources/avro/user.avsc b/src/main/resources/avro/user.avsc new file mode 100644 index 0000000..833291b --- /dev/null +++ b/src/main/resources/avro/user.avsc @@ -0,0 +1,23 @@ +{ + "type": "record", + "name": "UserTO", + "namespace": "de.juplo.kafka.wordcount.query", + "fields": [ + { + "name": "username", "type": "string" + }, + { + "name": "firstName", "type": "string", "default": "" + }, + { + "name": "lastName", "type": "string", "default": "" + }, + { "name": "sex", "type": + { + "type": "enum", "name": "SexTO", + "symbols": [ "UNKNOWN", "FEMALE", "MALE", "OTHER" ], "default": "UNKNOWN" + }, + "default": "UNKNOWN" + } + ] +} -- 2.20.1