Kafka : Check if 2 topics have been caught up

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Kafka : Check if 2 topics have been caught up



I have 2 topics in kafka which I am double writing to. Their offsets are at different commit points to begin with. My consumer starts consuming from the second topic late, but eventually will catch up with the first topic. How can I optimally find out if both of them are caught up ?



I am planning to look at a fixed window of previous messages consumed from both the topics and check if the messages consumed are similar in nature. Any ideas of how I can find if they are similar ?



Any other ideas of how I can be sure that they have been caught up ?



Also, my topic has multiple partitions. The check should include if all partitions have been caught up.





List the consumer groups given your application group id
– cricket_007
Jul 13 at 3:25





are you writing exactly same amount of messages toboth topics? if so, sum of offsets (topic1) = sum of offsets (topic2) can give you very close results.
– AbhishekN
Jul 15 at 19:21




2 Answers
2



From command line or using consumer api's you can calculate the consumer lag. if the lag is not significant in both the consumers, then you can safely assume that both the topics are caught up.



Also, help me understand why do you need to write the same messages to two topics. You can have multiples consumers for a topic



You can calculate lag yourself by using the methods available here:



kafka.admin.ConsumerGroupCommand



https://github.com/apache/kafka/blob/bf237fa7c576bd141d78fdea9f17f65ea269c290/core/src/main/scala/kafka/admin/ConsumerGroupCommand.scala



There's a bit more detail in this answer:



https://stackoverflow.com/a/51749733/236528






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard