是否有任何模拟器/工具可生成用于流式传输的消息? [英] Is there any simulator/tool to generate messages for streaming?

查看:97
本文介绍了是否有任何模拟器/工具可生成用于流式传输的消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

出于测试目的,我需要模拟客户端以每秒生成100,000条消息的方式发送给kafka主题.有什么工具或方法可以帮助我生成这些随机消息吗?

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 random messages?

推荐答案

位于bin/kafka-producer-perf-test.sh(

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.

一个用法示例如下:

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

此处的键是--throughput 100000标志,该标志指示油门最大消息量约为每秒100000条消息"

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

这篇关于是否有任何模拟器/工具可生成用于流式传输的消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆