MCPcopy Index your code
hub / github.com/SciSpike/kafka-lab

github.com/SciSpike/kafka-lab @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
58 symbols 98 edges 13 files 3 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Kafka Course

Welcome

First, welcome to this course on Kafka.

Although Kafka is quite simple to install, we decided to make base it on Docker and Docker-Compose. This gives us a couple of advantages:

  • Easier installation:
  • As long as you can get Docker to run, we know that the Kafka installation will work
  • Install docker, then simply run the docker compose file
  • Consistency between Windows, Mac and Linux
  • The ability to scale up and down the Kafka cluster

Installing Docker

Our labs require that you have Docker installed and get Kafka up and running.

We describe how here.

Link to the labs

There are two tracks, each with its own Docker stack — start whichever one you're running:

  • Online (2×3h, self-paced) — the standard follow-the-instructions labs, on the lean single-broker stack (cd docker && docker compose up -d): labs/labs.md
  • Classroom (2 full days, instructor-led) — richer exercises that deliberately trigger real-world Kafka failures (lost writes, duplicate consumption) and measure the effect of tuning knobs, on a 3-broker cluster started once and left running (cd docker && docker compose -f docker-compose-classroom.yaml up -d): labs/classroom/classroom-labs.md

Outline — Online course (2 × 3 hours)

The self-paced online format: each lecture is paired with a short, follow-the-steps lab. Same slides as the classroom course below — the classroom course just adds many more (and richer) exercises.

DAY 1

  • Introduction (Lecture ~ 20 min)
  • Who are we?
  • What is Kafka?
  • First lab
  • Verify that everything is installed and working (Lab ~ 20 min)
  • Install Kafka through Docker
  • Run a simple example of Kafka
  • Introduction to Kafka (Lecture ~ 30 min)
  • Kafka under the hood
  • What is a topic?
  • What is a partition?
  • What is a producer?
  • What is a consumer?
  • Creating a topic and passing a message (Lab ~30 min)
  • Create a topic
  • Run a simple consumer
  • Run a simple producer
  • Dissecting the first example (Lecture/Discussion ~ 30 min)
  • Walk-through of the first lab
  • Question and answers
  • Design of Kafka topics and partitions (Lecture ~ 30 min)
  • Case study
  • How to select topics?
  • How to select partitions?
  • Exercise: Designing topics and partitions (Group Project ~ 20 min)
  • Design topics and partitions

DAY 2

  • Evaluation of the designs and suggested solutions (Discussion ~20 min)
  • Discussion of the suggested solution(s)
  • Recommended design of case study
  • Implement Topics and Partitions for case study (Lab ~30 min)
  • Define a topic and partition in Kafka
  • Create a consumer and producer
  • Run a test script
  • Scaling Kafka (Lecture ~30 min)
  • Kafka Brokers
  • Kafka Clusters
  • Cluster mirroring
  • Consumer groups
  • Streaming APIs for Kafka (Lecture ~20 min)
  • What is streaming?
  • Why use streams?
  • Programming to streams
  • Example streams using Spark
  • Streaming and IoT Case Study (Lab ~30 min)
  • Consume a stream from Kafka
  • Build a Spark application over the Kafka stream
  • Kafka Administration and Integration (Lecture ~30 Min)
  • Integration with Big Data tools (Storm, Spark, Hadoop)
  • Kafka Connect
  • Certified Kafka connectors
  • Kafka administration
  • Kafka monitoring
  • Security
  • Exactly once delivery

Outline — Classroom course (2 full days)

Same slides and lecture flow as the online course above — the only difference is the exercises. The two online sessions use light "follow the steps" labs; over two full days there is time for the richer, failure-focused exercises in labs/classroom/, which deliberately trigger real-world Kafka problems and measure the effect of tuning knobs. The lecture headings below match the slide deck; under each one are the exercises that belong with it. (For per-exercise staging, timing and talking points, see the separate instructor guide.)

DAY 1

DAY 2

Core symbols most depended-on inside this repo

start
called by 4
labs/06-Streaming/iot-kafka/gps-pump/src/main/java/app/GpsDeviceSimulator.java
toString
called by 3
labs/06-Streaming/iot-kafka/gps-monitor/src/main/java/app/LocationKey.java
reset
called by 3
labs/06-Streaming/iot-kafka/gps-pump/src/main/java/app/GpsDeviceSimulator.java
equals
called by 2
labs/06-Streaming/iot-kafka/gps-monitor/src/main/java/app/LocationKey.java
createOnlineMessage
called by 2
labs/04-Implement-Topics-And-Partitions/device-monitor/src/main/java/app/DeviceMonitor.java
getGeoHash
called by 1
labs/06-Streaming/iot-kafka/gps-monitor/src/main/java/app/LocationKey.java
getProperties
called by 1
labs/06-Streaming/iot-kafka/gps-monitor/src/main/java/app/GpsMonitor.java
getProperties
called by 1
labs/06-Streaming/iot-kafka/gps-pump/src/main/java/app/GpsDeviceSimulatorApp.java

Shape

Method 43
Class 15

Languages

Java100%

Modules by API surface

labs/04-Implement-Topics-And-Partitions/device-monitor/src/main/java/app/DeviceMonitor.java11 symbols
labs/06-Streaming/iot-kafka/gps-monitor/src/main/java/app/LocationKey.java7 symbols
labs/06-Streaming/iot-kafka/gps-pump/src/main/java/app/GpsDeviceSimulator.java6 symbols
labs/06-Streaming/heartbeat-streams/src/main/java/app/HeartbeatMonitor.java6 symbols
labs/classroom/A4-Slow-Poll-Eviction/slow-consumer/src/main/java/app/SlowConsumer.java5 symbols
labs/04-Implement-Topics-And-Partitions/device-simulator/src/main/java/app/DeviceSimulatorApp.java4 symbols
labs/04-Implement-Topics-And-Partitions/device-simulator/src/main/java/app/DeviceSimulator.java4 symbols
labs/06-Streaming/wordcount-kafka-streaming/src/main/java/app/StreamExample.java3 symbols
labs/06-Streaming/iot-kafka/gps-pump/src/main/java/app/GpsDeviceSimulatorApp.java3 symbols
labs/06-Streaming/iot-kafka/gps-monitor/src/main/java/app/GpsMonitor.java3 symbols
labs/classroom/A5-Exactly-Once/txn-producer/src/main/java/app/TxnProducer.java2 symbols
labs/02-Publish-And-Subscribe/producer/src/main/java/app/Producer.java2 symbols

For agents

$ claude mcp add kafka-lab \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact