Thursday 15 April 2010

java - Kafka high level consumer -


I am trying to use a high level consumer for batch to read messages. During reading this batch, my thread must stop at some point.

Either when all messages end in the subject or get the maximum offset at that point when reading and stopping the messages, until the maximum offset is reached.

I tried to use the code but the KafkaStream seems to be a blocked call and waits until another message arrives.

So 3 questions,

  1. How do I know that there is no other message than the subject has read?

  2. If there is an answer to the question given above, how can I stop listening to this topic now?

  3. What is the way to find the maximum offset when the batch reads start (I think simple consumers can do this) and at that time the high level consumer has to stop?

  4. You have the option to decide when a specified message No new messages have been sent to you, so all messages have been read. This consumer property can be set using consumer.timeout.ms . After being passed without any new messages coming without this specified value, the consumer user will throw an exception at the same time and you can get more out of that user.


No comments:

Post a Comment