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" <yaojing...@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-