Hello,
I am load testing my streaming application. Currently, I am calling the
producer.send a large number of times to queue up the messages, then running
the consumer to check the throughput.
The producer code looks like this:
for (long nEvents = 0; nEvents < loopCntrMax; nEvents++) {
long runtime = new Date().getTime();
String msg = "pubTime:"+runtime+ ",TestMessage-" + nEvents;
KeyedMessage<String, String> data = new KeyedMessage<String,
String>(topicToProduceTo, msg);
producer.send(data);
}
producer.close();
Obviously, this is sequential, takes a lot of time, and does not simulate a
real-time streaming source.
Ideally, I would like to publish say, thousands of messages at a time. Any
suggestions ?
Regards,
Saurav