是否有任何模拟器/工具来生成流消息? [英] Is there any simulator/tool to generate messages for streaming?

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

问题描述

出于测试目的,我需要模拟客户端每秒生成 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 (https://github.com/apache/kafka/blob/trunk/bin/kafka-producer-perf-test.sh).你可以参考 https://github.com/apache/kafka/blob/trunk/tools/src/main/java/org/apache/kafka/tools/ProducerPerformance.java#L106 弄清楚如何使用它.

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天全站免登陆