Krzysztof Mirek
Krzysztof Mirek

Reputation: 41

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?

Upvotes: 4

Views: 5332

Answers (1)

Dmitri T
Dmitri T

Reputation: 168197

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

Upvotes: 2

Related Questions