Test Kafka
Make sure all of your systems that rely on real-time data streaming with Kafka are properly tested with NeoLoad.
When you integrate NeoLoad with Kafka, you can simulate the production of messages to Kafka topics and the consumption of messages from them. That means you can analyze performance bottlenecks and system behavior under stress and guarantee your Kafka-based applications can handle expected loads. In addition, NeoLoad supports Avro.
Load test Kafka messaging
With NeoLoad, you have to manually connect or disconnect from Kafka. Your first execution automatically opens a connection, whether you're sending or receiving a message.
The connection stays open by default. To close the connection use the close parameter and set it to true
. If you want NeoLoad to create a new action for sending and receiving from Kafka set the close_receiver parameter to true
.
Send a message to a Kafka topic
To test sending messages to a specific Kafka topic, navigate to Kafka in Messaging and open Send Message. Then, enter the following Parameters:
-
bootstrap.servers (required): Specifies Kafka cluster connection points.
-
key (optional): Associates a key with the message.
-
key.serializer (optional): Convert keys to bytes. The default value is
StringSerializer
. Custom serializers, except for Avro, are not supported. -
topic (required): Identifies the target topic for message publication.
-
value (required): Contains the message content you want to publish.
-
value.serializer (optional): Converts values to bytes. The default value is
StringSerializer
. Custom serializers, except for Avro, are not supported.
Additional Parameters, such as headers, acks, retries, buffer.memory, batch.size, and compression.type enable detailed configuration, optimizing message sending according to testing needs.
Send a message to Kafka.
-
bootstrap.servers: server1.com:9093,server2.com:9093,server3.com.fr:9093,server4.com:9093,server5.com:9093
-
security.protocol: SSL
-
ssl.keystore.type: JKS
-
ssl.keystore.location: ${NL-CustomResources}/my-jks-file.jks
-
ssl.keystore.password: my-password
-
ssl.truststore.location: ${NL-CustomResources}/my-jks-file.jks
-
ssl.truststore.password: my-password
-
topic: my-topic
-
key.serializer: org.apache.kafka.common.serialization.StringSerializer
-
key: my-key
-
value.serializer: io.confluent.kafka.serializers.KafkaAvroSerializer
-
value: {"content":"test","date_time":"2/22/24"}
-
value.schema: mySchema
-
schema.registry.url: http://localhost:8081
Sending a Kafka message to a topic from NeoLoad via SSL with Avro
Receive messages from a Kafka topic
To test receiving messages from a specific Kafka topic, navigate to Kafka in Messaging and open Receive Messages. Then, enter the following Parameters:
Parameters
-
bootstrap.servers (required): Specifies Kafka cluster connection points.
-
group.id (optional): Specifies the consumer group the Kafka topic belongs to for message consumption.
-
key.deserializer (optional): Convert bytes back to keys. The default value is
StringDeserializer
. Custom serializers, except for Avro, are not supported. -
value.deserializer (optional): Converts bytes back to values. The default value is
StringDeserializer
. Custom serializers, except for Avro, are not supported.
-
topic (required): Designates the source topic for message consumption.
-
timeout (required): Determines the maximum wait time for incoming messages.
Additional Parameters, such as max.poll.records, failOnTimeout and close offer flexibility, tailoring message reception to multiple load testing scenarios.
Receive a message from Kafka.
-
bootstrap.servers: localhost:29092
-
topic: test
-
timeout: 30000
-
group.id: group
Receiving a Kafka message from a topic in NeoLoad
What's next
Want to record your load test cases, faster? Check out other test design elements that can help you on your load testing journey:
You're done reading? Design a test scenario and jump right into NeoLoad load performance testing.