This project demonstrates how to build and containerize a Kafka Streams application using :
The project contains a simple WordCount application : KStreamsWordCountTopology
- Build and package application
on Linux
$ ./mvnw compile jib:dockerBuild
or on Windows
$ mvnw.cmd compile jib:dockerBuild
Note: This Maven project uses the jib-plugin to build a Docker image named streaming-word-count:latest
.
In addition, we are using Azkarra-Worker image as parent which is available on DockerHub.
- Run Docker containers
$ docker-compose up -d
- Start a kafka-console-producer
$ docker-compose exec kafka /usr/bin/kafka-console-producer \
--topic streams-plaintext-input \
--broker-list kafka:9092
- Then, produce some messages
> Azkarra Streams rocks!
> WordCount
> I Heart Logs
> Kafka Streams
> Making Sense of Stream Processing
Ctrl+c
to exit producer
- Run Interactive Query
$ curl -sX POST 'http://localhost:8080/api/v1/applications/k-streams-word-count-topology-1-0/stores/count' \
--data '{ "type":"key_value", "query" : {"all":{} } }' | jq
- Access to Azkarra Dashboard
Open your favorite browser and go to : http://localhost:8080/ui
Join the Azkarra Streams community on Slack