I am not sure why the API is this way. I agree, that it seems reasonable
to do a single request for multiple topic partitions.

I cc'ed Jason. He might know more.



-Matthias

On 11/2/18 3:31 AM, hacker win7 wrote:
> Thanks for your reply, I want to know why new consumer did not add the 
> committed(TopicPartitions)?  Just modify the source in 
> committed(TopicPartition, Duration) from 
> ‘coordinator.fetchCommittedOffsets(Collections.single)’ to 
> ‘coordinator.fetchCommittedOffsets(TopicPartitions)’.
> Besides, call multiple times with committed() will send multiple request to 
> coordinator, maybe block in the middle request, why not accumulate the 
> multiple TopicPartitions and send one fetch offset request to coordinator?
> 
>> On Nov 2, 2018, at 04:20, Matthias J. Sax <matth...@confluent.io> wrote:
>>
>> You need to call `committed()` multiple times.
>>
>> -Matthias
>>
>> On 11/1/18 12:28 AM, hacker win7 wrote:
>>> Hi,
>>>
>>> After reviewing the KafkaConsumer source about API of *committed():*
>>> I found that old consumer support committed(mutipleTopicPartitions) to
>>> return multiple committed offset, while in new consumer, there is only
>>> committed(singleTopicPartition) and return only one committed offset.
>>>
>>> It is a little weird for me that why new consumer only support fetch single
>>> topic partition committed offset. I search some KIPs but didn't find the
>>> reason about this. Anyway, How to fetch multiple topic partitions committed
>>> offset in new consumer?
>>>
>>
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to