Re: high level consumer not working

2014-06-24 Thread Guozhang Wang
Hi Li Li, If you use the same consumer group id then offsets may have already been committed to Kafka, hence messages before that will not be consumed. Guozhang On Mon, Jun 23, 2014 at 6:09 PM, Li Li wrote: > no luck by adding props.put("auto.offset.reset", "smallest"); > but running consumer

Re: high level consumer not working

2014-06-23 Thread Li Li
no luck by adding props.put("auto.offset.reset", "smallest"); but running consumer after producer works. But in my use case, it's not alwasy true for this. Another question, The consumer should remember the offset. it's not very easy to use. On Mon, Jun 23, 2014 at 11:05 PM, Guozhang Wang wrote:

Re: high level consumer not working

2014-06-23 Thread Neha Narkhede
for (final KafkaStream stream : streams) { ConsumerIterator consumerIte = stream.iterator(); while (consumerIte.hasNext()) System.out.println("Message from Single Topic :: " + new String(consumerIte.next(). message())); } Besides what Guo

Re: high level consumer not working

2014-06-23 Thread Guozhang Wang
Did you start the consumer after the producer? The default behavior of the consumer is to "consume from the tail of the log", and hence if there is no new messages coming in after the consumer started, it will get nothing. You may set auto.offset.reset="smallest" and try again. Guozhang On Sun

high level consumer not working

2014-06-22 Thread Li Li
hi all, I am reading the book "apache kafka" and write a simple producer and consumer class. the producer works but the consumer hangs. The producer class: public static void main(String[] args) { String topic="test-topic"; Properties props = new Properties(); props.put("metadata.