cd src/main/resources/stack
docker-compose up
Download Kafka from: https://kafka.apache.org/downloads
Latest Currently: https://downloads.apache.org/kafka/3.3.1/kafka_2.13-3.3.1.tgz
Extract the downloaded Kafka
In order to run Kafka commands the Kafka binary need to be added to the classpath
Example ( Mac, Linux )
export PATH=$PATH:/Users/feketegabor/app/kafka_2.13-3.2.0/bin
Now the kafka-topics.sh
must be available in the console
cd src/main/resources
./createTopics.sh
Simply writes each event from the input topic to the output one
./gradlew runStreams
kafka-console-producer.sh --broker-list localhost:9092 --topic streams-input-topic --property parse.key=true --property key.separator=:
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic streams-output-topic --property print.key=true
Demonstrates some Stateless transformations
./gradlew runStatelessTransformations
kafka-console-producer.sh --broker-list localhost:9092 --topic stateless-transformations-input-topic --property parse.key=true --property key.separator=:
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic stateless-transformations-output-topic --property print.key=true
Demonstrates Stateful Transformations
./gradlew runAggregations
kafka-console-producer.sh --broker-list localhost:9092 --topic aggregations-input-topic --property parse.key=true --property key.separator=:
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic aggregations-output-charactercount-topic --property print.key=true
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic aggregations-output-count-topic --property print.key=true
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic aggregations-output-reduce-topic --property print.key=true
Demonstrates the Join operations ( inner, left, outer )
./gradlew runJoins
kafka-console-producer.sh --broker-list localhost:9092 --topic joins-input-topic-left --property parse.key=true --property key.separator=:
kafka-console-producer.sh --broker-list localhost:9092 --topic joins-input-topic-right --property parse.key=true --property key.separator=:
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic inner-join-output-topic --property print.key=true
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic left-join-output-topic --property print.key=true
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic outer-join-output-topic --property print.key=true
Demonstrates the Windowing functionality
./gradlew runWindowing
kafka-console-producer.sh --broker-list localhost:9092 --topic windowing-input-topic --property parse.key=true --property key.separator=:```
kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic windowing-output-topic --property print.key=true