kafka的performance脚本怎么用text呢?

How can I use the performance script of kafka with text?

我有这个命令:./bin/kafka-producer-perf-test.sh --broker-list=localhost:9092 --messages 10000000 --topic test --threads 10 --message-size 1000 --batch-size 100 --compression-codec 1

但我想 运行 只是发送空消息。

这是 KAFKA 提供的 Performance Tool,它可以帮助您根据需要生成消息数量、消息大小和批大小您的要求,但有一个条件,即数据将以 BYTE ARRAY 的形式生成。

如果您希望根据您的自定义生成消息,那么您可以编写自己的自定义生成器,因为此工具不会帮助您。