# Prerequisites

Everything below was tested on the versions listed; later versions of the
same major line are expected to work.

## 1. The lab repository (required)

This course drives the **kafka-lab** repository — a Maven multi-module lab
containing a 3-broker Kafka cluster definition, runnable Java lessons, and a
Spring Boot app used in Exercises 04–05. Obtain your copy from the course
author; this pack references it by relative path (`kafka-lab/…`) so a
checkout anywhere on your machine works.

You will use, specifically:

| Path in kafka-lab | Used for |
|---|---|
| `docker/docker-compose.yml` | 3-broker Kafka 3.9.0 (KRaft) + ksqlDB + Schema Registry |
| `scripts/up.sh`, `scripts/k`, `scripts/run.sh`, `scripts/run-spring.sh` | Cluster lifecycle, CLI wrapper, lesson runner |
| `lessons/src/main/java/lab/*.java` | The Java lessons (producer, consumer, admin) |
| `spring-lab/src/main/java/lab/spring/*.java` | The Spring Kafka app: blocking retries vs `@RetryableTopic` |

## 2. Software

| Tool | Version verified | Notes |
|---|---|---|
| Docker (+ compose v2) | Docker Engine with `docker compose` | The brokers, ksqlDB and Schema Registry run in containers |
| JDK | 25 (OpenJDK 25.0.1) | The lessons and spring-lab compile with `--release 25` |
| Maven | none needed — repo ships `./mvnw` (wrapper 3.9.9) | `scripts/run.sh` invokes it |
| Kafka CLI | 3.9.0 — inside the `apache/kafka:3.9.0` container | You never install Kafka locally |

Supported operating systems: **macOS and Linux** (verified on macOS with a
Linux Docker host). The lab scripts are bash — on Windows, use WSL2 with
Docker Desktop; that path was not verified by us.

## 3. Skills assumed

- Read Java comfortably (generics, lambdas, annotations).
- Basic Spring Boot (`@Configuration`, `@Component`, application.yml) — needed
  from Exercise 04 on.
- Comfortable in a terminal.

## 4. Ports you must have free (on the machine running Docker)

`9092`, `9095`, `9098` (brokers), `8088` (ksqlDB), `8081` (Schema Registry),
and `8082` (the Spring lab app). If 9092 is taken, Kafka clients will fail to
connect — see `TROUBLESHOOTING.md`.

## 5. If your Docker daemon is remote

The brokers advertise the address in `kafka-lab/docker/.env`
(`LAB_HOST_IP`). If Docker runs on your own machine, that value should be
`localhost`. If your Docker daemon runs on another host, set `LAB_HOST_IP`
to that host's address before starting the cluster. Every script and config
in the lab reads this one variable.

## 6. What you do NOT need

- No cloud account, no hosted Kafka, no API keys.
- No IDE required (an editor helps for reading the Java sources).
- No prior Kafka knowledge.
