Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are Apache Kafka topic name limitations?

Tags:

apache-kafka

I have just tried creating a Kafka topic "user:created" and saw this error in Kafka logs: Invalid character ':' in value part of property. I googled and found that in a mailing list people are talking about deprecating . and _ symbols too.

Which symbols can't be used in Apache Kafka topic names?

like image 446
Vasyl Boroviak Avatar asked May 06 '16 01:05

Vasyl Boroviak


People also ask

Is there a limit to Kafka topics?

No, there is no limit on the topic quantity. However, there is an upper limit on the aggregate number of partitions of topics.

Are Kafka topic names case sensitive?

Kafka topic names are case-sensitive.

Can we rename a Kafka topic?

Renaming Topic ? It is not possible or supported by Kafka, to rename a Kafka topic. As there are internal dependencies like consumer offset positions, offset checkpoint index etc, it is not an easy operation to rename. So as of now, only way to rename is, delete the topic and create another topic with a new name.

How do you name Kafka topics?

Naming Kafka Topics: Structure In its topic names, Kafka allows alphanumeric characters, periods (.), underscores (_), and hyphens (-). Although '_' and '. ' are allowed to be used together, they can collide due to limitations in metric names. It is best to pick one and use either, but not both.


1 Answers

According to source code for kafka 10

val legalChars = "[a-zA-Z0-9\\._\\-]" private val maxNameLength = 255 private val rgx = new Regex(legalChars + "+") 

So, max length is 255 symbols and letters, . (dot), _ (underscore), - (minus) can use used

In the Kafka 0.10 the maxNameLength was changed from 255 to 249. See commit

Also topics with a period . or underscore _ could collide in internal data structures, so you are advised to use either but not both (source).

like image 94
Natalia Avatar answered Oct 02 '22 22:10

Natalia