What should be naming convention of topic and part

2019-07-13 12:33发布

问题:

Here are some example I was trying to use for kafka,

I am not sure it is good to go with or any specific naming convention?

For Topic

  1. {name}_queue
  2. {name}_topic
  • Here I think first option is not good because Topic is not queue exactly.
  • In the term of Computer Science Queue means First Come First Out.
  • If partitions come into the picture in topic than Topic will be no longer queue because inside the topic partitions is part of queue and data comes from For Partitions
  1. {name}_partition
  2. {name}_{kafka topic name}_partition
  3. {name}_{kafka topic name}_part

回答1:

I think you're overthinking this. All you need to do is to assign a Kafka topic name that adheres to [a-zA-Z0-9\\._\\-]. So like-this or like_this or likeThis or even likethis. Kafka will handle partition names for you by adding topic-name-{partitionid} for each partition.



回答2:

There is no much written related to Kafka topics naming convention, but this may give you some guidance