Topic creation names a Kafka topic and assigns its partitions and replication factor. These settings balance parallel processing against reliability: more partitions support parallelism, while more replicas improve resilience. section 3.1.2
Create and inspect a changelog topic
Create products.prices.changelog with two partitions and two replicas using kafka-topics.sh. Then inspect it with --describe: Kafka reports each partition's leader, replicas, and in-sync replicas. In the example, broker 3 leads partition 0 and broker 1 leads partition 1. section 3.1.2
$ kafka-topics.sh \
--create \
--topic products.prices.changelog \
--replication-factor 2 \
--partitions 2 \
--bootstrap-server localhost:9092
Created topic procuts.prices.changelog.
Run the annotated kafka-topics.sh command to create a topic with an explicit name, replication factor, partition count, and bootstrap server. section 3.1.2
Partitions can be increased later with --alter, but the resulting distribution and leadership should be checked with --describe. section 3.1.2
