Re: Correct way to handle ConsumerTimeoutException

2014-08-14 Thread Chen Wang
Got it. Thanks guys! Chen On Wed, Aug 13, 2014 at 9:35 AM, Neha Narkhede wrote: > 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

Re: Correct way to handle ConsumerTimeoutException

2014-08-13 Thread Neha Narkhede
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 l

Re: Correct way to handle ConsumerTimeoutException

2014-08-12 Thread Guozhang Wang
Hi Chen, The rational of using the consumer timeout exception is to indicate when there is no more data to be consumed, and hence upon capturing the exception the consumer should be closed. If you want to restart the consumer in handling the timeout exception, then you should probably just increa

Correct way to handle ConsumerTimeoutException

2014-08-12 Thread Chen Wang
Folks, I am using consumer.timeout.ms to force a consumer jump out hasNext call, which will throw ConsumerTimeoutException. It seems that upon receiving this exception, the consumer is no longer usable and I need to call .shutdown, and recreate: try{ } catch (ConsumerTimeoutException ex) { logge