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

Jay Kreps commented on KAFKA-1956:
----------------------------------

Can you clarify the problem you were solving? It sounds like you are saying the 
following loop never prints anything even with records in the subscribed 
partitions:
{code}
while(true) {
  ConsumerRecords recs = consumer.poll(100)
  if(recs.count() > 0)
    System.out.println("Got records");
}
{code}
Is that correct? 

The change you made seems to try to keep internally looping until we get back 
some records. However this should not really be necessary since returning will 
just go back to the client's loop. Perhaps you are saying that returning an 
empty list of records, in the event that the user's timeout hasn't ellapsed is 
not useful?

> new consumer client can't fetch records from kafka server
> ---------------------------------------------------------
>
>                 Key: KAFKA-1956
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1956
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients, consumer
>    Affects Versions: 0.8.3
>            Reporter: Hongliang Su
>            Assignee: Neha Narkhede
>              Labels: patch
>         Attachments: 
> 0005-fix-new-consumer-client-can-t-fetch-records-from-kaf.patch
>
>   Original Estimate: 12h
>  Remaining Estimate: 12h
>
> new consumer client can't fetch records from kafka server
> suggestion:
> fetch response doesn't return even after one completeAll invoke
> block until the fetch response returns
> TODO: whether there is an effective way to wait until fetch response returns



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to