Dev
Kafka Topic Config Generator
Creating a Kafka topic without thinking through partitions, cleanup policy, and retention means changing settings that cannot safely change later — partition counts cannot be reduced once set. This tool generates the complete `kafka-topics.sh --create` command tuned to your use case. Name the topic and pick a use case — High-throughput events, Compacted (changelog), Low-latency small messages, or Long retention (audit). The generator sets a partition count, replication factor of 3, and the relevant `--config` flags: LZ4 and 7-day retention for high-throughput, `cleanup.policy=compact` for changelogs, zstd and a 64KB max for low-latency, gzip and a year of retention for audit. Paste into a shell with your bootstrap server address, adjust the partition count, and run.
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Name the topic.
- Pick the use case that fits the data.
- Click Generate to produce the create command.
- Paste it into a shell, set your broker, and run it.
Use Cases
- •Creating a Kafka topic with the right partitions and replication
- •Choosing a compacted policy for a changelog topic
- •Setting retention to match an event or audit use case
- •Recalling the kafka-topics create command flags
- •Standardising topic configuration across a team
Tips
- →Size partitions for peak throughput — you cannot reduce them later.
- →Use compaction for changelog topics, deletion for event streams.
- →Keep replication at three in production for durability.
- →Match retention to how long consumers might need to replay.
FAQ
why is the replication factor always 3
Three replicas allow the cluster to tolerate a broker failure while maintaining a quorum. A replication factor of 1 is only appropriate for local development where losing data on a restart is acceptable.
when should I use a compacted topic
`cleanup.policy=compact` is for changelog or state topics where only the latest value per key matters. Compaction retains the most recent record per key and discards older ones — ideal for materialising state in Kafka Streams or a consumer that wants current state only.
can I change the partition count after creating the topic
You can increase partitions but cannot decrease them. Increasing changes the key-to-partition mapping, which breaks ordering guarantees for keyed messages. Getting the partition count right at creation time matters.
You might also like
Popular tools from other categories that share themes with this one.
Try these next
More free tools from other corners of the catalog, picked by shared themes.