Minimal start for Kafka Broker development without Zookeeper
I lost a whole day trying to start dev with Kafka just because I couldn't figure out how to configure the environment 😭
This project provides:
- Apache Kafka broker with Kraft running in Docker
- Kafka UI for visual management and monitoring
- Python test scripts to verify producer/consumer functionality
- Docker and Docker Compose
- Python 3.7+ (for testing)
docker-compose up -d
This will start:
- Kafka broker on
localhost:9092
- Kafka UI on
http://localhost:8080
Check that containers are running:
docker-compose ps
Access Kafka UI in your browser at http://localhost:8080
to see the cluster status.
Install Python dependencies:
cd test
pip install -r requirements.txt
Run the test script:
python main.py
The script will:
- Send a test message to the
test_topic
- Consume and display the message
- Show success/error status
.
├── docker-compose.yml # Kafka and Kafka UI services
├── test/
│ ├── main.py # Python producer/consumer test
│ └── requirements.txt # Python dependencies
└── README.md # This file
- Port: 9092 (external), 29092 (internal Docker network)
- Mode: Combined broker and controller (KRaft mode)
- Auto-create topics: Enabled
- Port: 8080
- Cluster name: local
- Features: Topic management, message browsing, consumer groups
docker-compose down
To remove volumes and clean up completely:
docker-compose down -v