0
votes

I would like to produce messages to kafka using jmeter. I did find below recommendation to integrate with jmeter: Develop Apache Kafka producer and load testing using JMeter

I also found https://github.com/corunet/kloadgen which integrates with confluent schema and let you write avro messages to kafka topic.

I am trying to write below schema message to kafka using jmeter:

{"type":"record","name":"TestAvro","namespace":"com.test.abcd","fields":[{"name":"name","type":{"type":"string","avro.java.string":"String"}},{"name":"value","type":{"type":"array","items":{"type":"map","values":{"type":"string","avro.java.string":"String"},"avro.java.string":"String"}}}]}

Its an array of map. I have not found libraries that can write this to kafka in jmeter.

Is there any other way to write above message out to kafka topic?

2

2 Answers

0
votes

The easiest option is going for Pepper-Box - Kafka Load Generator JMeter Plugin, it will add a new entry com.gslab.pepper.sampler.PepperBoxKafkaSampler to JMeter's Java Request sampler so you should be able to use it for establishing Kafka connection and sending your payload.

Just add Kafka Avro Serializer to JMeter Classpath and change value.serializer to io.confluent.kafka.serializers.KafkaAvroSerializer.class

More information: Apache Kafka - How to Load Test with JMeter

0
votes

Disclaimer, I'm the main developer behind the Kloadgen plugin. Sorry for the late answer, didn't saw this question, but Kloadgen support array of map as well map of arrays for primitive types. If you have a problem with that please feel free open an issue. Nowadays we are just improving collection handling so for version 4.0 it will be improve.