Without looking at your complete code, I'm only going to make some guesses.

Unless you really want to shutdown the consumer, why would you call
consumer.shutdown()? A consumer will keep waiting for new messages unless
otherwise specified.

I'm guessing you used something like while iterator.hasNext() to get
messages from the queue. This will not return unless you explicitly call
shutdown which means you will have to write a condition which calls
shutdown based on the message contents.

--
Sharninder



On Tue, Aug 5, 2014 at 10:51 AM, anand jain <[email protected]> wrote:

> Hi,
>
> I just started with Apache Kafka and wrote a high level consumer program
> following the example given here
> https://cwiki.apache.org/confluence/display/KAFKA/Consumer+Group+Example.
>
> Though, I was able to run the program and consume the messages, I have one
> doubt regarding *consumer.shutdown()*. It has never been called. I used the
> below piece of code to verify
>  if (consumer != null) {
>     System.out.println("shutting down consumer");
>     consumer.shutdown();
> }
>
> Has someone encountered this before? Also, even if consumer didn't
> shutdown, I didn't notice any bottleneck. Is it really needed?
>
> Regards
> Anand
>

Reply via email to