Repository navigation
debezium/dbz#1809 Standardize Examples — KStreams DDD Aggregates - #505
Conversation
Signed-off-by: samson30 <60385580+samson30@users.noreply.github.com>
- Add kstreams/test.yaml and run it in the kstreams workflow - Move the maven-dependency-plugin version to the parent POM (3.11.0) - Use fedora-minimal:44 for the aggregator runtime image - Remove the build section from connect_source, which rebuilt the MongoDB image under the quay.io/debezium/connect tag Signed-off-by: samson30 <60385580+samson30@users.noreply.github.com>
Thanks @Naros! I have added While testing, I also removed the The test doesn't cover the MongoDB sink part of the README, since that builds a Connect 2.0 image and compiles the hpgrahsl connector from source. If you'd like, I can look at moving it to Debezium's own MongoDB sink connector in a follow-up PR. |
|
Thanks for all the work @samson30, merged & applied! 🎉 |
Relates to debezium/dbz#1809.
Description
Moves
kstreams/poc-ddd-aggregatesonto the shared parent POM, as agreed in debezium/dbz#1809, using the same repository-root Docker build as #503.pom.xmlnow usesdebezium-examples-parent: Java 21 (was 11) and the compiler version come from the parent, and Kafka moves from 1.0.0 to the parent's 4.3.1 (kafka-streams,kafka-clients).kafka_2.11broker dependency and the Confluent repository.jackson-databindis now declared directly (BOM managed, 2.21.2), since the serdes use it and it previously only came in throughkafka_2.11.StreamingAggregatesDDDis updated for the Kafka Streams 4.x API:Consumedmoved to thekstreampackage,Serialized(removed in Kafka 3.0) is replaced byGrouped, andCACHE_MAX_BYTES_BUFFERING_CONFIG(deprecated since 3.4) is replaced bySTATESTORE_CACHE_MAX_BYTES_CONFIG.docker-compose.yaml), with aDockerfile.dockerignorelimiting it to the rootpom.xmland this module's files. The JDK stage useseclipse-temurin:21-jdkinstead of downloading OpenJDK 11, the build stage usesmaven:3.9-eclipse-temurin-21, and the jlink module list was regenerated withjdepsfor the new dependencies. Dependencies are now copied with-DincludeScope=runtime, because Kafka 4.x declaresslf4j-api,zstd-jni,lz4-javaandsnappy-javaas runtime dependencies and they would otherwise be missing from the image.actions/setup-javawith Temurin 21 and includes the rootpom.xmlin the Maven cache key.Verification (local, JDK 21)
mvn clean installsucceeds;dependency:treeshows kafka-streams and kafka-clients 4.3.1 and jackson-databind 2.21.2.docker compose build aggregatorsucceeds, with a 23 kB build context.kafka,mysql,connect_sourceandaggregatorand registeredmysql-source.json: the aggregator prints the customer and address aggregates for customers 1001 to 1004, updating customer 1001 in MySQL produces an updated aggregate, andfinal_ddd_aggregatescontains the JSON aggregates.Notes
SLF4J(W): No SLF4J providers were found. Before this change the only binding came in throughkafka_2.11(slf4j-log4j12) without a log4j configuration, so the example had no log output then either; its results are printed withPrinted.toSysOut(). I can add a binding such asslf4j-simpleif you would like Kafka Streams logs.connect_sinkanddebezium-mongodb/Dockerfile) is unchanged; this PR only covers the Maven module.