Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Apache Kafka Topic Creation

From Leeroopedia


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:

  1. Validation: Verify partition count > 0, replication factor between 1 and Short.MAX_VALUE, and topic name doesn't collide with existing topics.
  2. Replica Assignment: Either let the controller assign replicas automatically based on partition count and replication factor, or accept explicit manual assignments.
  3. Metadata Propagation: The controller creates the topic metadata and propagates it to all brokers via the metadata protocol.
  4. Configuration Application: Topic-level configurations are stored and applied to the new topic's log segments.

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment