kafkacat: add page (#2430)

italian
Chris 2018-10-26 20:50:16 +02:00 committed by Starbeamrainbowlabs
parent e9303a92f6
commit 9113ebb028
1 changed files with 35 additions and 0 deletions

35
pages/common/kafkacat.md Normal file
View File

@ -0,0 +1,35 @@
# kafkacat
> Apache Kafka producer and consumer tool.
- 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}}`