kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Laubenthal, Horst (NEUSTA CONSULTING)" <Horst.Laubent...@otto.de>
Subject Java KafkaClient
Date Fri, 02 Oct 2015 08:15:45 GMT

We are just trying to use one of your Kafka Clients: KafkaConsumer  (org.apache.kafka.clients.consumer)
and was wondering why no Messages are returned by the poll method described in your examples...

Then, I saw your implementation of the poll method and was a bit confused:

     * Fetches data for the topics or partitions specified using one of the subscribe APIs.
It is an error to not have subscribed to
     * any topics or partitions before polling for data.
     * <p> 
     * The offset used for fetching the data is governed by whether or not {@link #seek(Map)
     * is used. If {@link #seek(Map) seek(offsets)} is used, it will use the specified offsets
on startup and
     * on every rebalance, to consume data from that offset sequentially on every poll. If
not, it will use the last checkpointed offset 
     * using {@link #commit(Map, boolean) commit(offsets, sync)} 
     * for the subscribed list of partitions.
     * @param timeout  The time, in milliseconds, spent waiting in poll if data is not available.
If 0, waits indefinitely. Must not be negative
     * @return map of topic to records since the last fetch for the subscribed list of topics
and partitions
    public Map<String, ConsumerRecords<K,V>> poll(long timeout) {
        // TODO Auto-generated method stub
        return null;

Didn't you want to implement this?

View raw message