[ 
https://issues.apache.org/jira/browse/KAFKA-10059?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bob Barrett updated KAFKA-10059:
--------------------------------
    Description: 
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:

```// Negative offset indicates that the group has no committed offset for this 
partition
if (offset < 0) {
 groupOffsetsListing.put(topicPartition, null);
}

``` 

It would be better to return a non-null value that indicates the lack of an 
offset, such as `OffsetAndMetadata(-1, Optional.empty(), metadata)`. 

  was:
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:



 

 

It would be better to return a non-null value that indicates the lack of an 
offset, such as `OffsetAndMetadata(-1, Optional.empty(), metadata)`. 


> 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:
> ```// Negative offset indicates that the group has no committed offset for 
> this partition
> if (offset < 0) {
>  groupOffsetsListing.put(topicPartition, null);
> }
> ``` 
> 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.3.4#803005)

Reply via email to