[ 
https://issues.apache.org/jira/browse/KAFKA-10059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17868865#comment-17868865
 ] 

Ksolves India Limited commented on KAFKA-10059:
-----------------------------------------------

[~bob-barrett] This ticket needs further elaboration on the issue. 
Additionally, include logs if this is causing any problems.

Based on our analysis, changing the null value to OffsetAndMetadata(-1, 
Optional.empty(), metadata) would result in an IllegalArgumentException with 
the message "invalid negative offset." Therefore, this change is not necessary 
unless an exception is thrown with the current null value.

> KafkaAdminClient returns null OffsetAndMetadata value when there is no 
> committed offset for a partition
> -------------------------------------------------------------------------------------------------------
>
>                 Key: KAFKA-10059
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10059
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Bob Barrett
>            Priority: Minor
>
> When listing consumer group offsets through the admin client, the map that we 
> return has a null `OffsetAndMetadata` value if the partition has no committed 
> offset:
> {code:java}
> // Negative offset indicates that the group has no committed offset for this 
> partition
> if (offset < 0) {
>     groupOffsetsListing.put(topicPartition, null);
> } {code}
> It would be better to return a non-null value that indicates the lack of an 
> offset, such as `OffsetAndMetadata(-1, Optional.empty(), metadata)`. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to