rpk topic create
An rpk command that creates one or more topics, optionally setting the partition count, replication factor and topic properties.
In more detail
The -p flag sets partitions, -r sets the replication factor and -c sets a topic property such as cleanup.policy=compact. The command prints OK for each topic it creates.
Examples
rpk topic create m07l02-events -p 3 -r 3rpk topic create prices -c cleanup.policy=compactRelated terms
- rpk — The command-line tool that ships with Redpanda for starting brokers and managing topics, consumer groups and schemas.
- topic — A named channel in a publish-subscribe messaging system that producers write to and any number of subscribers read from.
- partition — One of several independent ordered logs a message stream is split into, with each message routed to one partition by its key.
- replication factor — The number of copies Kafka keeps of each partition, including the leader.
- cleanup.policy — The topic property that chooses how old records are removed: delete by retention, compact by key, or both.
Taught in
- Why A Log And Not A Queue — Apache Kafka & Event Streaming
- Topics, Partitions And Where A Record Lands — Apache Kafka & Event Streaming
- Keys And Ordering Per Partition — Apache Kafka & Event Streaming
- Log Compaction: A Topic As A Table — Apache Kafka & Event Streaming
- In-Sync Replicas And Minimum ISR — Apache Kafka & Event Streaming