Skip to content

sep2/KBookDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

KBookDemo aims to provide a simple way to define real-time streaming data processing from a DAG (directed acyclic graph). End-user submits DAG definition (called KBook, which will be run as Kafka Streams Tasks) to the server and the server is responsible for start/stop/monitor these instances. Since the DAG itself is just a json description of the graph (see sample1.json), it is possible to visually build the DAG using some sort of frontend and provide interactive development experiences. For example, inspect the schema of nodes or see sample data flowing through edges.

Each node in the DAG definition represents a logic processing step, e.g. branch-filtering, aggregation, generic state machine, sanitizing, or other independent business logic units. Behind the sense, the DAG is translated into an instance of Kafka Streams Topology. It is worth mentioned that in spite of this demo leveraging Kafka Streams to provide parallelism and fault-tolerance, the same algorithm/concept can be used in other streaming data processing frameworks (Spark, Flink) as well. You can see how the algorithm is applied in KBook.Scala.

The next step in the roadmap is to to turn on High Availability with Zookeeper.

Usage

Mill is the build tool used by KBookDemo.

compile

mill server.compile

Assembly Jar

mill server.assembly

Run

java -jar KBookDemo.jar

Make the DAG

please refer to sample1.json. Make sure the KBook has a uuid, which is typically generated by frontend (the DAG Maker).

Submit

curl -d "@sample1.json" -H "Content-Type: application/json" -X POST https://localhost:9999/book/post

Play

curl -X POST https://localhost:9999/book/play?uuid=the_kbook_uuid_submitted

Stop

curl -X POST https://localhost:9999/book/stop?uuid=the_kbook_uuid_submitted

Delete

curl -X POST https://localhost:9999/book/delete?uuid=the_kbook_uuid_submitted

Query

curl -X POST https://localhost:9999/book/show?uuid=the_kbook_uuid_submitted

Show Possible Nodes

curl -X GET https://localhost:9999/node/list

License

GNU GPLv3

About

Kafka Topics organized as KBook.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages