简体   繁体   English

Kafka API,用于获取主题详细信息,例如分区和偏移量

[英]Kafka APIs for getting topic details like Partition and Offset

We have Node and Java applications uses Kafka clients. 我们有使用Java和Kafka客户端的Node和Java应用程序。

Current requirement is to get the current offset for each partition for given topic. 当前要求是获取给定主题的每个分区的当前偏移量。

We are able to see details in Confluent control center and need to get that information to display in our application. 我们能够在Confluent控制中心看到详细信息,并且需要获取该信息以显示在我们的应用程序中。

您可以调用KafkaConsumer.endOffsets(Collection<TopicPartition> partitions)以获取给定主题的给定分区的结束偏移量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM