Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to configure JMeter to listen to a kafka topic?

We have a system that exposes an HTTP endpoint which triggers some internal operations and sends asynchronously a message to kafka queue. We'd like to measure performance where the input is the HTTP request and the expected output is a message published to the queue.

We're evaluating if JMeter is the right tool for such measurement. While HTTP requests are trivial, Kafka listener not at all. Is there any way to configure/extend JMeter to read a message from a specific topic and (ideally) put some assertions on it?

like image 593
Krzysztof Mirek Avatar asked Sep 15 '25 11:09

Krzysztof Mirek


1 Answers

Check out Writing a Kafka Consumer in Java article, it explains how you can connect to Kafka topic and read messages using Java code.

With regards to JMeter, given you have kafka-clients library (with all dependencies) under JMeter Classpath you should be able to re-use the Java Kafka Consumer code in i.e. JSR223 Sampler

See Apache Kafka - How to Load Test with JMeter article for more detailed instructions if needed

like image 100
Dmitri T Avatar answered Sep 18 '25 10:09

Dmitri T