Consume from beginning
Read first 10 messages from a topic
kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic my-topic --from-beginning --max-messages 10
More kafka commands
-
kafka-topics.sh --bootstrap-server kafka:9092 --alter --topic my-topic --partitions 12Increase partition count (cannot decrease)
-
kafka-configs.sh --bootstrap-server kafka:9092 --describe --entity-type topics --entity-name my-topicShow all overridden config values for a topic
-
kafka-configs.sh --bootstrap-server kafka:9092 --alter --entity-type topics --entity-name my-topic --add-config retention.ms=604800000Set 7-day retention on a topic
-
kafka-broker-api-versions.sh --bootstrap-server kafka:9092List all API versions supported by the broker
-
kafka-topics.sh --bootstrap-server kafka:9092 --listList all Kafka topics in the cluster