- Start zookeeper and kafka
brew install zookeeper kafka
brew services start zookeeper
brew services start kafka
- Create topics
WordCount with real-time query
sbt runMain WordCount
- Start producer
./start_count_producer
- Start consumer
./start_count_consumer
- Send a message to producer: "Hello world"
- Consumer has counts stream
- Get realtime counts numbers
http GET http://127.0.0.1:8080
sbt runMain MapAll
- Start producer
./start_map_producer
- Start consumer
./start_map_consumer
- Send a message to producer: {"type": "message", "a": 1}
- Message is in consumer
- Send another message to producer: {"type": "command", "b": 2}
- Nothing in consumer
EventCount with windowed count
sbt runMain EventCount
- Start producer
./start_events_producer
- Send some random messages to producer
- Get realtime counts by minute
http GET http://127.0.0.1:8080
- Wait for a minute
- Send some random messages to producer
- Get more realtime counts by minute
http GET http://127.0.0.1:8080
JoinCounts with KStream to KTable join
sbt runMain WordCount
sbt runMain JoinCounts
- Start wordcount producer
./start_count_producer
- Start joincount producer
./start_join_producer
- Start joincount consumer
./start_join_consumer
- Send message to join producer
{"word": "hello"}
- No result in joincount consumer
- Send message to wordcount producer
hello and hello world
- Wait for stream to update
- Output json will contain current word count
{"word":"hello","count":2}