Principle:Apache Kafka Topic Creation
| Knowledge Sources | |
|---|---|
| Domains | Administration, Data_Management |
| Last Updated | 2026-02-09 12:00 GMT |
Overview
An administrative operation that creates new Kafka topics with specified partition count, replication factor, and configuration.
Description
Topic Creation establishes a new named topic in the Kafka cluster with a defined number of partitions and replication factor. The partition count determines parallelism, while the replication factor determines fault tolerance. Topics can also be created with custom configurations (retention, cleanup policy, etc.) and manual replica assignments for advanced placement control.
Usage
Use this principle when provisioning new topics for producers and consumers. Topic creation must happen before any messages can be published, unless auto-creation is enabled on the broker.
Theoretical Basis
The creation involves distributed coordination:
- Validation: Verify partition count > 0, replication factor between 1 and Short.MAX_VALUE, and topic name doesn't collide with existing topics.
- Replica Assignment: Either let the controller assign replicas automatically based on partition count and replication factor, or accept explicit manual assignments.
- Metadata Propagation: The controller creates the topic metadata and propagates it to all brokers via the metadata protocol.
- Configuration Application: Topic-level configurations are stored and applied to the new topic's log segments.