Skip to content

Files

Latest commit

f2e2fd5 · Jul 23, 2020

History

History

streams-movie-demo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Apr 22, 2020
May 29, 2019
Apr 22, 2020
Jul 23, 2020
Jul 23, 2020
Apr 22, 2020
Apr 22, 2020
Apr 22, 2020
Apr 22, 2020
Apr 22, 2020
Apr 22, 2020
Jul 8, 2019
May 6, 2019
Nov 21, 2018
Apr 22, 2020
Apr 16, 2019
Apr 22, 2020
Apr 22, 2020
Apr 22, 2020
Apr 1, 2020

Kafka Streams and KSQL Demo

Note
NEW✨: Full playbook is here

This repo is a storehouse of bits of code useful for demonstrating Kafka Streams and Confluent KSQL. By way of expectation management, it’s not a coherent demo project as such, but it does have useful things in it that you might want to know how to use.

Building

The main Gradle build file names all the dependencies needed to build the project. The build file doesn’t contain any tasks to run the demo, but is useful as an illustration

Running gradlew idea will generate IntelliJ IDEA project files. It is from there that I typically run StreamsDemo.java, which has a main() method containing a simple Kafka Streams application.

Test Data

The data directory contains two strangely-formatted data files, movies.dat and ratings.dat. These are parsed by io.confluent.demo.Parser into Avro objects called io.confluent.demo.Movie and io.confluent.demo.Rating. This all happens for free in StreamsDemo.java.

That directory also contains JSON versions of the data called movies-json.js and ratings-json.js. These are handy for demonstrating Streams and KSQL operating on JSON data.

The Gradle tasks streamJSONRatings and streamAvroRatings will run the JSONRatingStreamer and AvroRatingStreamer tasks, respectively. (A future refactoring should combine those two.) These classes generate randomized ratings on a subset of films, each with its own target average rating. This is handy for demos.