Hello Horst, I think you are using Kafka version <= 0.8.2. The new consumer, org.apache.kafka.clients.consumer, is being worked on and will be available in 0.9.0, however it will be marked unstable for 0.9.0. You can follow Apache Kafka docs <http://kafka.apache.org/documentation.html#simpleconsumerapi> to get started with consuming from your Kafka cluster.
On Fri, Oct 2, 2015 at 1:15 AM, Laubenthal, Horst (NEUSTA CONSULTING) < horst.laubent...@otto.de> wrote: > Hi, > > 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) seek(offsets)} > * 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 > */ > @Override > public Map<String, ConsumerRecords<K,V>> poll(long timeout) { > // TODO Auto-generated method stub > return null; > } > > Didn't you want to implement this? > > Thanks > Horst -- Regards, Ashish