kafka-lab ready for producers and consumers.
- A running Kafka cluster (e.g., via Docker).
- Kafka UI configured and accessible.
- Apache Kafka Documentation for deeper reference.
1. Creating a Topic via the Kafka UI
- In the Kafka UI sidebar, select Topics.
- Click Add a topic.
- Enter Topic name:
kafka-lab
Topic names cannot contain spaces or special characters. Use hyphens (
-) or underscores (_) to separate words.- Configure the following options:
- Number of partitions:
1 - Message retention:
7 days
- Number of partitions:
- Leave the remaining settings at their defaults and click Create topic.

Why These Settings Matter
| Configuration | Purpose | Example Impact |
|---|---|---|
| Number of partitions | Parallelism & distribution across brokers | More partitions = higher throughput |
| Message retention | Duration Kafka retains messages before deletion | 7 days = temporary event storage |
2. Verifying Your Topic
After creation, you can confirm the topic details in the UI:
- Partitions: How many shards the topic is split into.
- Replication factor: Number of copies for fault tolerance.
- Message count: Total events stored so far.
3. (Optional) Creating a Topic via CLI
For automation or scripting, use thekafka-topics.sh tool:
Next Steps
- Produce and consume messages with
kafka-console-producer.shandkafka-console-consumer.sh. - Monitor topic metrics in the Kafka UI or Prometheus.
- Explore advanced topic configurations in the Kafka topic configuration reference.