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?
No, there is no limit on the topic quantity. However, there is an upper limit on the aggregate number of partitions of topics.
Kafka topic names are case-sensitive.
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.
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.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With