How to get consumer Kafka lag in java
问题 I have a producer in java and consumer in nodeJS. I want to know in java what is the consumer lag, so i know if i can produce more data to the topic. What is the API in java to get the consumer lag? 回答1: Why do you need to know the consumer lag ? The aim of a broker is to produce messages asynchronously. If you need to have a synchronous processing, use a basic rest processing. 回答2: The actual class you can call from Java is the kafka.admin.ConsumerGroupCommand . It's Scala code, but it's