How to see the retention for a particular topic in kafka

后端 未结 4 601
星月不相逢
星月不相逢 2020-12-24 01:33

I want to see the retention period set for a particular topic. Is there any command? I tried with

bin/kafka-topics.sh --zookeeper hostname:2181 --alter --con         


        
4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-24 02:03

    Alternative ways:

    1. use call sh-command through a container
    docker run --rm -it confluentinc/cp-kafka:latest sh -c "kafka-topics --zookeeper 11.22.33.44:5555 --describe --topic topic-name"
    

    1. use Kafka Tool


    Take into account that it would be displayed just params different from default values.

    At the example above, the retention.ms is 14 days, when default one is 7 days.

提交回复
热议问题