I found some weird behavior,
I follow the exact code example for HighlevelConsumer

https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example#

but add one debug line here
"
    public void run() {
        ConsumerIterator<byte[], byte[]> it = m_stream.iterator();
        while (it.hasNext()){

* ////////////////////////////////////////////my line
here//////////////////////////////////////////////////*
* System.out.println("from the stream" + m_stream); \\This line will be
blocked. KafkaStream.toString() is a blocking method?????*
* /////////////////////////////////////////// end of my line
///////////////////////////////////////////////////////*
*
*
            System.out.println("Thread " + m_threadNumber + ": " + new
String(it.next().message()));
 }
        System.out.println("Shutting down Thread: " + m_threadNumber);
    }
"

Reply via email to