如何从 kafka 客户端获取模式和 kafka 主题信息?

How to get schema along with kafka topic information from kafka client?

我可以看到,在 java 客户端中,我们可以使用 Admin.describeTopics(Collection) 获取主题列表及其配置。有没有办法从那个调用中取回模式?

我是 kafka 的新手,不确定如何从注册表中获取主题信息和模式并将它们重新组合在一起。感谢任何提示或文档!

Kafka 对模式一无所知,也不将它们存储为主题的一部分。

您可以使用 io.confluent:kafka-schema-registry-client

中的 CachedSchemaRegistryClient

https://docs.confluent.io/current/schema-registry/develop/api.html