[ https://issues.apache.org/jira/browse/KAFKA-12781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17345867#comment-17345867 ]
Guozhang Wang commented on KAFKA-12781: --------------------------------------- I did not review the original PR so do not know we were updating the end offsets by looping through all the records.. I'm wondering if we can just leverage on the new API that [~vvcephei] added for the other KIP: `consumer.currentLag`. I.e. within the `StreamThread` after we got the records, use `consumer.position + consumer.currentLag` to get the `endOffset`, instead of looping through the returned offsets?? > Improve the endOffsets accuracy in TaskMetadata > ------------------------------------------------ > > Key: KAFKA-12781 > URL: https://issues.apache.org/jira/browse/KAFKA-12781 > Project: Kafka > Issue Type: Improvement > Components: streams > Affects Versions: 2.8.0 > Reporter: Walker Carlson > Priority: Minor > > Currently `TaskMetadata#endOffsets()` returns the highest offset seen by the > main consumer in streams. It should be possible to get the highest offset in > the topic via the consumer instead. -- This message was sent by Atlassian Jira (v8.3.4#803005)