Search code examples
apache-kafkaapache-kafka-streamsconfluent-platform

How to create partitions in Kafka Topics with customer name/id


I am trying to create topics with 100 partitions and I want each partition to have a unique name or id so producer knows exactly which partition to use to send the event. I am using Confluent Kafka so I used UI to create a topic with 100 partitions but it did not provide me an option to choose the name or any key for the partition?

Here is the link that I am following: https://docs.confluent.io/platform/current/control-center/topics/create.html

Language: .NET

Is there a way to specify/customize the partition id?


Solution

  • You can't name partitions in Kafka, only topics have names. Partitions are always numbered starting from 0 for each topic.

    You can either use 100 topics with different names or use a Partitioner that computes the partition number of each event.