Skip to content

Sales aggregator demo using features of Kafka Streams

License

Notifications You must be signed in to change notification settings

kevinsimard/kafka-streams-aggregator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kafka Streams Aggregator

Code Structure

├── src
│   └── main
│       └── java
│           └── com
│               └── kevinsimard
│                   └── kafka
│                       └── streams
│                           └── Application.java
├── .editorconfig
├── .gitattributes
├── .gitignore
├── LICENSE.md
├── README.md
└── pom.xml

Usage

Create Kafka topics with the following commands.

$ kafka-topics --zookeeper localhost --create --partitions 1 --replication-factor 1 --topic sales-raw
$ kafka-topics --zookeeper localhost --create --partitions 1 --replication-factor 1 --topic sales-aggregated

Run mvn compile exec:java to run the application.

Use the Kafka console producer tool to test the application.

$ kafka-console-producer --broker-list localhost:9092 --topic sales-raw

Enter the following message to start aggregating numbers.

# Format: {"user_id":<int>,"sale_id":<int>,"total":<double>}
{"user_id":1,"sale_id":1,"total":100.00}

Use the Kafka console consumer tool to view aggregated messages.

$ kafka-console-consumer --bootstrap-server localhost:9092 --from-beginning --topic sales-aggregated

License

This package is open-sourced software licensed under the MIT license.

About

Sales aggregator demo using features of Kafka Streams

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published