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 <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
>



-- 
-- Guozhang

Reply via email to