Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # user >> High Level consumer commits


Copy link to this message
-
High Level consumer commits
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

 
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB