What are Apache Kafka topic name limitations?

2019-03-17 05:50发布

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?

1条回答
家丑人穷心不美
2楼-- · 2019-03-17 06:15

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

In the Kafka 0.11 class Topic was moved to internal package source

查看更多
登录 后发表回答