Kafka Consumer hanging at .hasNext in java

后端 未结 2 853
粉色の甜心
粉色の甜心 2021-01-04 21:20

I have a simple Kafka Consumer in java with the following code

    public void run() {
        ConsumerIterator it = m_stream.iterator(         


        
2条回答
  •  猫巷女王i
    2021-01-04 21:54

    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

提交回复
热议问题