Is there any simulator/tool to generate messages for streaming?

后端 未结 3 1850
感情败类
感情败类 2021-02-05 15:04

For testing purpose, I need to simulate client for generating 100,000 messages per second and send them to kafka topic. Is there any tool or way that can help me generate these

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-05 15:47

    There's a built-in tool for generating dummy load, located in bin/kafka-producer-perf-test.sh (https://github.com/apache/kafka/blob/trunk/bin/kafka-producer-perf-test.sh). You may refer to https://github.com/apache/kafka/blob/trunk/tools/src/main/java/org/apache/kafka/tools/ProducerPerformance.java#L106 to figure out how to use it.

    One usage example would be like that:

    bin/kafka-producer-perf-test.sh --broker-list localhost:9092 --messages 10000000 --topic test --threads 10 --message-size 100 --batch-size 10000 --throughput 100000
    

    The key here is the --throughput 100000 flag which indicated "throttle maximum message amount to approx. 100000 messages per second"

提交回复
热议问题