Kafka Lab — Windows Setup
Operational guide to run the lab locally on Windows. For curls and test cases see Try it yourself.
Requirements
- Docker (
docker compose) - JDK 17 (Spring Boot 3)
- Maven (
mvn— do not usemvnwin this lab) - JEnv (optional; lab scripts use it)
Ports
| Service | Port |
|---|---|
| Producer | 8097 |
| Consumer | 8197 |
| Kafdrop | 19000 |
| Kafka | 9092 |
Java 17 (one time)
cd D:\Backup\develop\curso-apache-kafka-master
jenv local jdk17
java -version
If Maven still reports Java 8, set JAVA_HOME explicitly:
$env:JAVA_HOME = "D:\java\corretto-17.0.13-2"
mvn -version
Startup order
- Kafka stack:
docker compose up -d→ verify withdocker compose ps - Consumer (terminal 1):
run-consumer.batormvn spring-boot:runinstr-consumer - Producer (terminal 2):
run-producer.batormvn spring-boot:runinstr-producer - Test:
curl -X POST http://localhost:8097/casos/01-basico -H "Content-Type: text/plain" -d "Hola Kafka"
Kafdrop UI: http://localhost:19000
Common pitfalls
| Problem | Solution |
|---|---|
mvnw fails |
Use mvn or run-*.bat scripts |
java -version ≠ Maven Java |
Set JAVA_HOME to JDK 17 |
| JEnv broken global | jenv local jdk17 in project root |
What this lab uses (and does not)
| Included | Not in this lab |
|---|---|
| Spring Kafka (Cases 01–07) | ksqlDB |
Kafka Streams (Case 08 — str-streams) |
Spring @EnableKafkaStreams (uses plain KafkaStreams API) |