A tutorial into the world of Apache Kafka.
This repo contains a few directories of code and config to allow one to become more familiar with Kafka. Kafka can be a little daunting at first with a lot of new jargon and lots of libraries. This repo aims to create a fun, easy way to explore Apache Kafka.
If you find this in any way helpful, make sure to star the repository. If you find an issues, please open an issue or fork the repo and create a pull request with your fix.
Throughout this tutorial, you will be building an application that takes a stream of points and creating a Pinball High Score board using Kafka. In a real world environment, your pinball game would be producing the points, game ids, etc., but we will be producing them from a static list as an exercise.
For those that enjoy music while coding, enjoy some American Rock with Pinball Wizard: Youtube, Apple Music, Spotify
The first folder you should explore is the Infra folder. In there you will find a docker compose file that will let you spin up a kafka cluster, and a few more pieces for this tutorial. This tutorial assumes that you have docker installed. You can also try using podman with podman-compose but this is untested and currently unsupported.
If you cd
into the infra folder, you should be able to do a docker-compose up
command and have everything come up. This may take a while the first time, as
there are a lot of large images associated with Kafka.
Once you have the containers up and running, run the setup.sh
file to create a few
topics and other resources needed for this tutorial.
Once you have the supporting infrastructure up you are ready to proceed to Part 1
Once you are done, make sure you stop all containers and remove them:
# in infra/
docker-compose stop
docker-compose rm
# Remove unused images and volumes
# Cleans up space
docker system prune --all
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.