Produce messages from stdin

Produce key:value messages interactively

kafka-console-producer.sh --bootstrap-server kafka:9092 --topic my-topic --property 'key.separator=:' --property 'parse.key=true'

tool
kafka20 commands
tags
kafka

More kafka commands

  • kafka-console-consumer.sh --bootstrap-server kafka:9092 --topic my-topic --from-beginning --max-messages 10

    Read first 10 messages from a topic

  • kafka-topics.sh --bootstrap-server kafka:9092 --alter --topic my-topic --partitions 12

    Increase partition count (cannot decrease)

  • kafka-configs.sh --bootstrap-server kafka:9092 --describe --entity-type topics --entity-name my-topic

    Show 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=604800000

    Set 7-day retention on a topic

  • kafka-broker-api-versions.sh --bootstrap-server kafka:9092

    List all API versions supported by the broker

all 20 kafka commands