Re: High Level consumer commits

2014-07-16 Thread Guozhang Wang
Hello Guy, One thing you can do is to turn off auto.commit.offset and then only commit offset after try/catch block, and then in the catch block stop and restart the consumer so that the message will be re-consumed. Guozhang On Wed, Jul 16, 2014 at 8:16 AM, Guy Doulberg wrote: > Hi, > > Is th

Re: High Level consumer commits

2014-07-16 Thread Jun Rao
You can turn off auto commits and issue commitOffsets() periodically. See the api in http://kafka.apache.org/documentation.html#highlevelconsumerapi. Thanks, Jun On Wed, Jul 16, 2014 at 8:16 AM, Guy Doulberg wrote: > Hi, > > Is there a way to commit consuming of events only if I had ran code

High Level consumer commits

2014-07-16 Thread Guy Doulberg
Hi, Is there a way to commit consuming of events only if I had ran code successfully? In other words, In this code while (it.hasNext()) { /** Iterator on kafka High lever consumer*/ try { MessageAndMetadata current = it.next(); dealWithEvent(cu