You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by jingguo yao <ya...@gmail.com> on 2018/07/18 08:41:09 UTC

If timeout is short, the first poll does not return records

If the timeout is short say 100, the first poll does not return
records for my case. Jay Kreps gave an explanation on [1]. I think
that this behaviour for poll is counterintuitive, it will make Kafka
user's life much easier if this behaviour is documented in [2].

[1] http://grokbase.com/p/kafka/users/155mqpwf3n/consumer-poll-returns-no-records-unless-called-more-than-once-why
[2] http://kafka.apache.org/11/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html#poll-long-

Re: If timeout is short, the first poll does not return records

Posted by "Thakrar, Jayesh" <jt...@conversantmedia.com>.
While this does not answer your question, I believe during the first call, a lot of things happen - e.g. get admin and metadata info about the cluster, etc.
That takes "some time" and hence the poll interval that is acceptable/norm for regular processing may not be sufficient for initialization AND I believe also during periodic metadata update/refresh.

On 7/18/18, 3:41 AM, "jingguo yao" <ya...@gmail.com> wrote:

    If the timeout is short say 100, the first poll does not return
    records for my case. Jay Kreps gave an explanation on [1]. I think
    that this behaviour for poll is counterintuitive, it will make Kafka
    user's life much easier if this behaviour is documented in [2].
    
    [1] http://grokbase.com/p/kafka/users/155mqpwf3n/consumer-poll-returns-no-records-unless-called-more-than-once-why
    [2] http://kafka.apache.org/11/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html#poll-long-