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 <guy.doulb...@perion.com>
wrote:

> 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<Message> current = it.next();
>
>                 dealWithEvent(current);
>                 }catch (Exception e){
>
>                 }
> }
>
> What should I do, If I want events that ended up in the catch, will be
> read again by another consumer or the same consumer until the they don't
> throw exception.
>
>
> Thanks, Guy
>

Reply via email to