What are Apache Kafka topic name limitations?

Solution 1:

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).