Kafka consumer list

前端 未结 8 1825
日久生厌
日久生厌 2020-12-12 19:38

I need to find out a way to ask Kafka for a list of topics. I know I can do that using the kafka-topics.sh script included in the bin\\ directory.

8条回答
  •  星月不相逢
    2020-12-12 19:56

    I do not see it mentioned here, but a command that i use often and that helps me to have a bird's eye view on all groups, topics, partitions, offsets, lags, consumers, etc

    kafka-consumer-groups.bat --bootstrap-server localhost:9092 --describe --all-groups
    

    A sample would look like this:

    GROUP TOPIC PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG CONSUMER-ID HOST CLIENT-ID
    Group Topic 2          7               7               0      XXXX 
    :
    :
    

    The most important column is the LAG, where for a healthy platform, ideally it should be 0(or nearer to 0 or a low number for high throughput) - at all times. So make sure you monitor it!!! ;-).

    P.S:
    An interesting article on how you can monitor the lag can be found here.

提交回复
热议问题