I have been looking around Apache kafka for implementing a HighLevel consumer (I do not want to play with the message, I just simply need to put the data into MongoDB) v0.8.1.1
I have looked at below links which shows very great details about how to implement the consumer.
Apache Kafka consumer wiki Another kafka consumer
But I am still clueless as to how the Consumer restarts after all the threads are shutdown. E.g. Lets say I have 4 threads of consumer running and they consumed all the messages from kafka broker so once there are no messages all the consumers will do nothing and after specific timeout it will be shutdown so I am not sure that how the consumer is again restarted when there are new messages in kafka broker.
Can someone share some code or atleast some pointers on this. Also is there a way where we can have our business logic in some callback method which will get called when there are messages instead of having while loop.