Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # user >> Correct way to handle ConsumerTimeoutException


Copy link to this message
-
Re: Correct way to handle ConsumerTimeoutException
I am using consumer.timeout.ms to force a consumer jump out hasNext call,
which will throw ConsumerTimeoutException.

Yes, this is the downside of the blocking iterator approach. If you want to
pull data in batches and process messages, the iterator is not the best API
as it can block at any time longer than your app is comfortable with. To
fix this and a bunch of other problems with the consumer API, we are
working on a new consumer client, that will replace the existing one and
will support completely new APIs.

Take a look at the new APIs here
<http://people.apache.org/~nehanarkhede/kafka-0.9-consumer-javadoc/doc/org/apache/kafka/clients/consumer/KafkaConsumer.html>.
Let us know if you have feedback.
On Tue, Aug 12, 2014 at 4:37 PM, Guozhang Wang <[EMAIL PROTECTED]> wrote: