创建topic时,名字中 不要有 . 、_,否则提示警告信息,如下:
WARNING: Due to limitations in metric names, topics with a period ('.') or underscore ('_') could collide. To avoid issues it is best to use either, but not both.
在Kafka的内部会根据topic的名称来命名metrics的名称,并且会将句点号 . 改成下划线 _。
当topic的名称为 topic.1_2,还有一个topic的名称为 topic_1.2,那么最后的metrics的名称都为 topic_1_2,所以就会发生名称冲突。
举例如下,首先创建一个以 topic.1_2 名称的topic,提示WARNING警告,之后在创建一个topic.1_2 时发生InvalidTopicException异常。
感谢:
https://blog.csdn.net/u013256816/article/details/79303825