I have a simple Kafka Consumer in java with the following code
public void run() {
ConsumerIterator it = m_stream.iterator(
The method hasNext()
is blocking.
you can change the timeout of the blocking in the propertyconsumer.timeout.ms
Note that it will throw a TimeoutException
when the timeout will expire.
Would read these docs about the consumers: https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example
The solution was to add the property
"consumer.timeout.ms"
Now when the timeout is reached a ConsumerTimeoutException is thrown