On 03/30/2015 04:35 AM, Sandeep Bishnoi wrote: > > The consumer.poll() api is returning null always. Although the remaining > code is based on the returned value from poll. > > Can you please let me know whether > org.apache.kafka.clients.consumer.KafkaConsumer is a valid API to use if I > want to create a client which can read from a given partition of a given > topic. > > Best Regards, > Sandeep >
The KafkaConsumer class is still being implemented, so this is the expected behavior for right now. The Java Client API is brand new, and the Consumer API is not ready for production yet AFAIK. I have no idea when the next release will be, but it still looks this has not been implemented yet: https://github.com/apache/kafka/blob/0.8.2/clients/src/main/java/org/apache/kafka/clients/consumer/KafkaConsumer.java#L555 I've been hitting the same issue since I just started playing with Kafka, so I'm going to wait for future releases. I think the old Scala consumer API is the only way to go right now. Regards, Alec