1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-21 21:42:08 +02:00
tldr/pages/common/kafkacat.md
Lucas Gabriel Schneider a5fe31bc47
multiple pages: format technical tokens (#5119)
Co-authored-by: bl-ue <54780737+bl-ue@users.noreply.github.com>
Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
2021-01-31 12:05:18 -05:00

975 B

kafkacat

Apache Kafka producer and consumer tool. More information: https://github.com/edenhill/kafkacat.

  • Consume messages starting with the newest offset:

kafkacat -C -t {{topic}} -b {{brokers}}

  • Consume messages starting with the oldest offset and exit after the last message is received:

kafkacat -C -t {{topic}} -b {{brokers}} -o beginning -e

  • Consume messages as a Kafka consumer group:

kafkacat -G {{group_id}} {{topic}} -b {{brokers}}

  • Publish message by reading from stdin:

echo {{message}} | kafkacat -P -t {{topic}} -b {{brokers}}

  • Publish messages by reading from a file:

kafkacat -P -t {{topic}} -b {{brokers}} {{path/to/file}}

  • List metadata for all topics and brokers:

kafkacat -L -b {{brokers}}

  • List metadata for a specific topic:

kafkacat -L -t {{topic}} -b {{brokers}}

  • Get offset for a topic/partition for a specific point in time:

kafkacat -Q -t {{topic}}:{{partition}}:{{unix_timestamp}} -b {{brokers}}