Git Product home page Git Product logo

pepper-box's Introduction

Pepper-Box - Kafka Load Generator

Build Status Coverage Status


Pepper-Box is kafka load generator plugin for jmeter. It allows to send kafka messages of type plain text(JSON, XML, CSV or any other custom format) as well as java serialized objects.

Getting Started


Pepper-Box includes four main components

  • PepperBoxKafkaSampler : This is jmeter java sampler sends messages to kafka.
  • Pepper-Box PlainText Config : This jmeter config element generates plaintext messages based on input schema template designed.
  • Pepper-Box Serialized Config : This jmeter config element generates serialized object messages based on input class and its property configurations.
  • PepperBoxLoadGenerator : This is standalone utility which can be used without jmeter.

Setup


Requirement

Pepper-Box uses Java 8 with java compiler API, hence on JMeter machine JDK 8 should be installed instead of JRE 8.

Install openjdk on Debian, Ubuntu, etc.,

sudo apt-get install openjdk-8-jdk

Install openjdk on Fedora, Oracle Linux, Red Hat Enterprise Linux, etc.,

su -c "yum install java-1.8.0-openjdk-devel"

For windows you can download oracle JDK 8 setup from here

Build Project

mvn clean install -Djmeter.version=3.0 -Dkafka.version=0.9.0.1

JMeter and Kafka version can be passed dynamically.

Once build is completed, copy jar file to JMETER_HOME/lib/ext directory.

PepperBoxKafkaSampler


This is java sampler hence in ThreadGroup add sampler as Java Request and select class as com.gslab.pepper.sampler.PepperBoxKafkaSampler

PepperBoxKafkaSampler

As you can see in above screen, you can configure producer properties and topic details.

  • bootstrap.servers : broker-ip-1:port, broker-ip-2:port, broker-ip-3:port
  • zookeeper.servers : zookeeper-ip-1:port, zookeeper-ip-2:port, zookeeper-ip-3:port. Note : Any one of bootstrap or zookeeper server detail is enough. if zookeeper servers are given then bootstrap.servers are retrieved dynamically from zookeeper servers.
  • kafka.topic.name : Topic on which messages will be sent
  • key.serializer : Key serializer (This is optional and can be kept as it is as we are not sending keyed messages).
  • value.serializer : For plaintext config element value can be kept same as default but for serialized config element, value serializer can be "com.gslab.pepper.input.serialized.ObjectSerializer"
  • compression.type : kafka producer compression type(none/gzip/snappy/lz4)
  • batch.size : messages batch size(increased batch size with compression like lz4 gives better throughput)
  • linger.ms : How much maximum time producer should wait till batch becomes full(should be 5-10 when increased batch size and compression is enabled)
  • buffer.memory : Total buffer memory for producer.
  • acks : Message sent acknowledgement, value can be (0/1/-1).
  • send.buffer.bytes : The size of the TCP send buffer (SO_SNDBUF) to use when sending data. If the value is -1, the OS default will be used.
  • receive.buffer.bytes : The size of the TCP receive buffer (SO_RCVBUF) to use when reading data. If the value is -1, the OS default will be used.
  • security.protocol : kafka producer protocol. Valid values are: PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL.
  • message.placeholder.key : Config element message variable name. This name should be same as message placeholder key in serialized/plaintext config element.
  • kerberos.auth.enabled : YES/NO if it is disabled all below properties will be ignored
  • java.security.auth.login.config : jaas.conf of kafka Kerberos
  • java.security.krb5.conf : Kerberos server krb5.conf file
  • sasl.kerberos.service.name : Kafka Kerberos service name

Above properties are added by default in sampler as those are more significant in terms of performance in most of the cases. But you can add other non listed kafka properties with prefix "_".

For example to enable SSL properties you can add below properties

_ssl.key.password
_ssl.keystore.location
_ssl.keystore.password
_ssl.keystore.type
_ssl.truststore.location
_ssl.truststore.password
_ssl.truststore.type

Note: These are just sample properties, SSL properties are already included in kafka sampler.

Pepper-Box PlainText Config


Pepper-Box PlainText Config is jmeter config element. It takes schema template is input and generates message for each sampler request.

Pepper-Box PlainText Config

You can add this config element using Thread group --> Add --> Config Element --> Pepper-Box PlainText Config

Input schema template can be in any format

JSON schema template

{
	"messageId":{{SEQUENCE("messageId", 1, 1)}},
	"messageBody":"{{RANDOM_ALPHA_NUMERIC("abcedefghijklmnopqrwxyzABCDEFGHIJKLMNOPQRWXYZ", 100)}}",
	"messageCategory":"{{RANDOM_STRING("Finance", "Insurance", "Healthcare", "Shares")}}",
	"messageStatus":"{{RANDOM_STRING("Accepted","Pending","Processing","Rejected")}}",
	"messageTime":{{TIMESTAMP()}}
}

XML schema template

<message>
	<messageId>{{SEQUENCE("messageId", 1, 1)}}</messageId>
	<messageBody>{{RANDOM_ALPHA_NUMERIC("abcedefghijklmnopqrwxyzABCDEFGHIJKLMNOPQRWXYZ", 100)}}</messageBody>
	<messageCategory>{{RANDOM_STRING("Finance", "Insurance", "Healthcare", "Shares")}}</messageCategory>
	<messageStatus>{{RANDOM_STRING("Accepted","Pending","Processing","Rejected")}}</messageStatus>
	<messageTime>{{TIMESTAMP()}}</messageTime>
</message>

Custom schema template

Hello {{FIRST_NAME()}}

	This is sample message sending at {{DATE("dd/MM/yyyy HH:mm:ss")}}.

Thanks and Regards,
{{FIRST_NAME()}} {{LAST_NAME()}}

Pepper-Box Serialized Config


Java serialized objects can be sent to kafka using Pepper-Box Serialized Config Element. This config element can be added using Thread group --> Add --> Config Element --> Pepper-Box Serialized Config

Pepper-Box PlainText Config

Follow below steps to use this config element,

  • Enter fully qualified name in class name section (e.g. com.gslab.pepper.Message in above screen). This class should be present in jmeter classpath folder(lib or lib/ext). You can copy jar containing required class to JMETER_HOME/lib/ext folder.
  • Click on load button which will populate all fields of given class with default values as Ignore means field value will not set.
  • Assign function expression to each field.

Example Class,

package com.gslab.pepper;
import java.io.Serializable;
public class Message  implements Serializable{

    private long messageId;
    private String messageBody;
    private String messageStatus;
    private String messageCategory;
    private long messageTime;

    public long getMessageId() {
        return messageId;
    }

    public void setMessageId(long messageId) {
        this.messageId = messageId;
    }

    public String getMessageBody() {
        return messageBody;
    }

    public void setMessageBody(String messageBody) {
        this.messageBody = messageBody;
    }

    public String getMessageStatus() {
        return messageStatus;
    }

    public void setMessageStatus(String messageStatus) {
        this.messageStatus = messageStatus;
    }

    public String getMessageCategory() {
        return messageCategory;
    }

    public void setMessageCategory(String messageCategory) {
        this.messageCategory = messageCategory;
    }

    public long getMessageTime() {
        return messageTime;
    }

    public void setMessageTime(long messageTime) {
        this.messageTime = messageTime;
    }
}

Please make sure that function return type and field data type should be compatible with each other.

PepperBoxLoadGenerator

PepperBoxLoadGenerator is console plaintext load generation utility.

Command,

java -cp pepper-box-1.0.jar  com.gslab.pepper.PepperBoxLoadGenerator --schema-file <schema file absolute path> --producer-config-file <producer properties absoulte path>  --throughput-per-producer <throughput rate per producer> --test-duration <test duration in seconds> --num-producers <number of producers>

Example

  • Schema file
{
	"messageId":{{SEQUENCE("messageId", 1, 1)}},
	"messageBody":"{{RANDOM_ALPHA_NUMERIC("abcedefghijklmnopqrwxyzABCDEFGHIJKLMNOPQRWXYZ", 100)}}",
	"messageCategory":"{{RANDOM_STRING("Finance", "Insurance", "Healthcare", "Shares")}}",
	"messageStatus":"{{RANDOM_STRING("Accepted","Pending","Processing","Rejected")}}",
	"messageTime":{{TIMESTAMP()}}
}
  • producer properties file
bootstrap.servers=<Broker List>
zookeeper.servers=<Zookeeper List>
kafka.topic.name=<kafka topic>
key.serializer=org.apache.kafka.common.serialization.StringSerializer
value.serializer=org.apache.kafka.common.serialization.StringSerializer
acks=0
send.buffer.bytes=131072
receive.buffer.bytes=32768
batch.size=16384
linger.ms=0
buffer.memory=33554432
compression.type=none
security.protocol=PLAINTEXT
kerberos.auth.enabled=NO
java.security.auth.login.config=<JAAS File Location>
java.security.krb5.conf=<krb5.conf location>
sasl.kerberos.service.name=<Kerberos service name>

For schema file and producer properties file most of the features same as jmeter plain text config element.

We have also included pepper_box.jmx jmeter sample test file which can be directly imported in jmeter.

Schema Template Functions


Pepper-Box provides various template functions for random data generation,

Function Details Example(For serialized use without {{ }}) Returns
TIMESTAMP() current time in long {{TIMESTAMP()}} Long
TIMESTAMP(startDate, endDate) Random long date between two Dates {{TIMESTAMP("01-05-1998 10:30:12","03-03-2017 12:12:12")}} Long
DATE(format) current date with given format {{DATE("dd-MM-yyyy HH:mm:ss")}} String
RANDOM_STRING(string1, string2, string3,...) Random string among given {{RANDOM_STRING("ONE","TWO","THREE","FOUR")}} String
RANDOM_INT(int1, int2, int3,...) Random integer among given {{RANDOM_INT(1, 2, 3, 4)}} Integer
RANDOM_FLOAT(float1, float2, float3,...) Random float among given {{RANDOM_FLOAT(1.1F ,2.1F, 3.1F, 4.1F)}} Float
RANDOM_DOUBLE(double1, double2, double3,...) Random double among given {{RANDOM_DOUBLE(1.1, 2.1, 3.1, 4.1)}} Double
RANDOM_LONG(long1, long2, long3,...) Random long among given {{RANDOM_LONG(1, 2, 3, 4)}} Long
RANDOM_INT_RANGE(min, max) Random integer among given {{RANDOM_INT_RANGE(1,100)}} Integer
RANDOM_FLOAT_RANGE(min, max) Random float between min and max {{RANDOM_FLOAT_RANGE(1.0F, 100.0F)}} Float
RANDOM_FLOAT_RANGE(min, max) Random double between min and max {{RANDOM_FLOAT_RANGE(1.0, 100.0)}} Double
RANDOM_LONG_RANGE(min, max) Random long between min and max {{RANDOM_LONG_RANGE(1,100)}} Long
FIRST_NAME() Random first name {{FIRST_NAME()}} String
LAST_NAME() Random last name {{LAST_NAME()}} String
RANDOM_ALPHA_NUMERIC(charSet, length) Random string of given length from given char set {{RANDOM_ALPHA_NUMERIC("abcdefghijklmn", 10)}} String
UUID() Random UUID {{UUID()}} String
SEQUENCE(sequenceId, startValue, incrementBy) Generates incremental sequence {{SEQUENCE("messageId", 1, 1)}} Long
PHONE() Random 10 digit phone number {{PHONE()}} String
GENDER() Random gender {{GENDER()}} String
BOOLEAN() Random boolean {{BOOLEAN()}} boolean
EMAIL(domain) Random email id for given domain {{EMAIL("test.com")}} String
USERNAME() Random username {{USERNAME()}} String
IPV4() Random IPV4 address {{IPV4()}} String
IPV6() Random IPV6 address {{IPV6()}} String

Custom Functions

Apart from these functions, you can also add your own custom function in com.gslab.pepper.input.CustomFunctions class. Please make sure that those are static functions.

Example

public static float AVG(float... floats){
        int count = floats.length;
        float sum = 0.0;
        for (float number : floats){
            sum += number;
        }
        return sum/count;
    }

AVG function can be used in schema as shown below,

{{AVG(32.2, 34.5, 64.2)}}

Note: While writing custom functions, please try to keep data in memory or scale your function as much other functions otherwise your custom function itself becomes performance bottlneck. e.g. you need some record ids from RDBMS for some schema fields, instead of querying every time bring all ids inmemory and get random id from those ids.

You can also add manipulations on template functions, for example TIMESTAMP() function returns time in milliseconds but you can get time in seconds,

{{java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds(TIMESTAMP())}}

Special Thanks!

pepper-box's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pepper-box's Issues

mvn build failure

I haven jmeter version 3.1 and kafka verson 0.11.0

when i try to build project using

mvn clean install -Djmeter.version=3.1 -Dkafka.version=0.11.0.0

there is build failure

[INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for pepper-box:pepper-box:jar:1.0 [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.kafka:kafka_2.11:jar -> duplicate declaration of version ${kafka.version} @ line 54, column 17 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building pepper-box 1.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ pepper-box --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ pepper-box --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Copying 6 resources [INFO] [INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ pepper-box --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 26 source files to /home/anmol/pepper-box/target/classes [INFO] /home/anmol/pepper-box/src/main/java/com/gslab/pepper/loadgen/impl/PlaintTextLoadGenerator.java: Some input files use unchecked or unsafe operations. [INFO] /home/anmol/pepper-box/src/main/java/com/gslab/pepper/loadgen/impl/PlaintTextLoadGenerator.java: Recompile with -Xlint:unchecked for details. [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ pepper-box --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory /home/anmol/pepper-box/src/test/resources [INFO] [INFO] --- maven-compiler-plugin:3.6.0:testCompile (default-testCompile) @ pepper-box --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 7 source files to /home/anmol/pepper-box/target/test-classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /home/anmol/pepper-box/src/test/java/com/gslab/pepper/test/PepperBoxSamplerTest.java:[65,9] cannot find symbol symbol: class Time location: class com.gslab.pepper.test.PepperBoxSamplerTest [ERROR] /home/anmol/pepper-box/src/test/java/com/gslab/pepper/test/PepperBoxLoadGenTest.java:[59,9] cannot find symbol symbol: class Time location: class com.gslab.pepper.test.PepperBoxLoadGenTest [INFO] 2 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.103 s [INFO] Finished at: 2018-03-01T13:00:57+05:30 [INFO] Final Memory: 36M/347M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:testCompile (default-testCompile) on project pepper-box: Compilation failure: Compilation failure: [ERROR] /home/anmol/pepper-box/src/test/java/com/gslab/pepper/test/PepperBoxSamplerTest.java:[65,9] cannot find symbol [ERROR] symbol: class Time [ERROR] location: class com.gslab.pepper.test.PepperBoxSamplerTest [ERROR] /home/anmol/pepper-box/src/test/java/com/gslab/pepper/test/PepperBoxLoadGenTest.java:[59,9] cannot find symbol [ERROR] symbol: class Time [ERROR] location: class com.gslab.pepper.test.PepperBoxLoadGenTest [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

can you help me with this

Compilation failed with Jmeter 4.0 and Kafka 2.11.1.1.1 with errors 'cannot find symbol'

Getting below error message while compiling, -

[INFO] 24 warnings
[INFO] -------------------------------------------------------------
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/username/Downloads/pepper-box-jmeter3.2_kafka10.2/src/main/ja
va/com/gslab/pepper/sampler/PepperBoxKafkaSampler.java:[19,40] cannot find symbo
l
symbol: class SecurityProtocol
location: package org.apache.kafka.common.protocol
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.922 s
[INFO] Finished at: 2018-09-13T12:44:36+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
6.0:compile (default-compile) on project pepper-box: Compilation failure
[ERROR] /C:/Users/username/Downloads/pepper-box-jmeter3.2_kafka10.2/src/main/ja
va/com/gslab/pepper/sampler/PepperBoxKafkaSampler.java:[19,40] cannot find symbo
l
[ERROR] symbol: class SecurityProtocol
[ERROR] location: package org.apache.kafka.common.protocol
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption

Jmeter trying to run Pepper-Box PlainText Config in jmeter 2.4 version

i am seeing the error in the jmeter log file for the kafka- Pepper-Box PlainText Config plugin i m using.

48:52 INFO - jmeter.engine.StandardJMeterEngine: All threads have been started
:48:52 ERROR - jmeter.testbeans.TestBeanHelper: This should never happen. com.gslab.pepper.config.plaintext.PlainTextConfigElement setGenerator 1 java.lang.String java.lang.IllegalArgumentException: argument type mismatch
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.jmeter.testbeans.TestBeanHelper.invokeOrBailOut(TestBeanHelper.java:157)
at org.apache.jmeter.testbeans.TestBeanHelper.prepare(TestBeanHelper.java:90)
at org.apache.jmeter.threads.TestCompiler.trackIterationListeners(TestCompiler.java:140)
at org.apache.jmeter.threads.TestCompiler.subtractNode(TestCompiler.java:110)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:992)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:989)
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:971)
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:449)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:239)
at java.base/java.lang.Thread.run(Thread.java:834)
:52 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.Error: java.lang.IllegalArgumentException: argument type mismatch
at org.apache.jmeter.testbeans.TestBeanHelper.invokeOrBailOut(TestBeanHelper.java:160)
at org.apache.jmeter.testbeans.TestBeanHelper.prepare(TestBeanHelper.java:90)
at org.apache.jmeter.threads.TestCompiler.trackIterationListeners(TestCompiler.java:140)
at org.apache.jmeter.threads.TestCompiler.subtractNode(TestCompiler.java:110)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:992)
at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:989)
at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:971)
at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:449)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:239)
at java.base/java.lang.Thread.run(Thread.java:834)
how to resolve this

Support for SASL

I am trying to connect IBM message hub which is based on Kafka 0.10.2.1 through pepper-box plugin.
It uses SASL_Plaintext protocol. So in PepperBox Kafka sampler, i am setting attributes as below.
security.protocol=SASL_PLAINTEXT
java.security.auth.login.config= "Path to my jaas.conf"

When I run the script i get error "org.apache.kafka.common.KafkaException: java.lang.IllegalArgumentException: You must pass java.security.auth.login.config in secure mode." even i have already passed jaas.conf file.

I am not sure if SASL is already supported by pepper-box and I am missing something.

Your help is appreciated.

Maven build failure when tried to build pepper-box with latest version of Jmeter

I ran the below command on my local to build the pepper box plugin to my tests but ended up with below
mvn clean install -Djmeter.version=5.1.1 -Dkafka.version=1.1.0

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project pepper-box: Compilation failure
[ERROR] /Users/thopukr/Documents/Automation/PerformanceTesting/pepper-box/src/main/java/com/gslab/pepper/sampler/PepperBoxKafkaSampler.java:[19,40] cannot find symbol
[ERROR] symbol: class SecurityProtocol
[ERROR] location: package org.apache.kafka.common.protocol
[ERROR]
[ERROR] -> [Help 1]

Uncaught error in kafka producer I/O thread: java.lang.NullPointerException: null ; jmeter.version=3.0 and kafka.version=0.9.0.1 , Running from Jmeter 4

I am running Pepper-Box from JMeter 4, unable to send the request to Kafka, facing a below-mentioned error.

2020-02-25 14:35:54,709 ERROR o.a.k.c.p.i.Sender: Uncaught error in kafka producer I/O thread:
java.lang.NullPointerException: null
at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:327) ~[pepper-box-1.0.jar:?]
at org.apache.kafka.common.network.Selector.poll(Selector.java:303) ~[pepper-box-1.0.jar:?]
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:349) ~[pepper-box-1.0.jar:?]
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:225) ~[pepper-box-1.0.jar:?]
at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:126) [pepper-box-1.0.jar:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_211]

Note:-- From Postman we are sending the request in from base64 format. it sending a response successfully. In client-end, we are using Kafka version 2.2 . So, in this case, do we need to have same kafka version for jmeter pom.xml.

jMeter 5.x and Kafka 2.x support.

Hello, I'm trying to make this work on JMeter 5.2.1 & Kafka 2.4.0I installed using brew on my mac and even when I put the JAR file on the folder "/usr/local/Cellar/jmeter/5.2.1/libexec/lib/ext" .. When I do right click on the thread group, add -> config element... Pepperbox is missing.

I notice that all screencaps I see are from JMeter 3.... this plugin works with 5.x?

I tried the command mvn clean install -Djmeter.version=5.2.1 -Dkafka.version=2.4.0 but at the end I get this error

[ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /Users/smoneta/github/pepper-box/src/main/java/com/gslab/pepper/sampler/PepperBoxKafkaSampler.java:[19,40] cannot find symbol symbol: class SecurityProtocol location: package org.apache.kafka.common.protocol [ERROR] /Users/smoneta/github/pepper-box/src/main/java/com/gslab/pepper/input/SchemaParser.java:[7,31] package org.apache.commons.lang does not exist [INFO] 2 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 05:46 min [INFO] Finished at: 2020-02-18T09:45:16-03:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project pepper-box: Compilation failure: Compilation failure: [ERROR] /Users/smoneta/github/pepper-box/src/main/java/com/gslab/pepper/sampler/PepperBoxKafkaSampler.java:[19,40] cannot find symbol [ERROR] symbol: class SecurityProtocol [ERROR] location: package org.apache.kafka.common.protocol [ERROR] /Users/smoneta/github/pepper-box/src/main/java/com/gslab/pepper/input/SchemaParser.java:[7,31] package org.apache.commons.lang does not exist [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Thanks.

Unable to start jmeter-3.3 after putting pepper-box-1.0 jar

Below is my environment :

  1. Mac OS
  2. Apache 3.3
  3. pepper-box 1.0 jar

After installing jar in jmeter plugin folder, I am getting error such as "An error occurred: Implementing class" + I am unable to find this plugin from Plugins manager .

Please help me out asap. Thank you.

Send key value with the messages

Hi,
I am trying to implement a test in which message should be sent with the key to kafka, so that when i consume the message (sent by jmeter) from kafka, i can see something like this:
[2018-02-20 08:47:45,206] INFO Message consumed: ConsumerRecord(topic = test, partition = 0, offset = 3437, CreateTime = 1519109958252, checksum = 1094544467, serialized key size = 82, serialized value size = 255, key = {"this is key"}, value = {"this is test message}})(com.messagehub.samples.ConsumerRunnable)

currently without key, i can see this:
[2018-02-20 09:23:50,700] INFO Message consumed: ConsumerRecord(topic = test, partition = 0, offset = 3542, CreateTime = 1519111430376, checksum = 3574368010, serialized key size = -1, serialized value size = 4499, key = null, value = {"this is test message}})(com.messagehub.samples.ConsumerRunnable)

I am not expert in kafka, so i am not sure if we already have such functionalities in pepper-box plugin and might be i just don't know how to use those features.

Thanks in advance.

Br,
Hitesh

usesr defined Variables pulled in at launch rather than realtime..

Using the Pepper box plain txt config.. to defin the message to be sent.. it seems jmeter variables usedin there or user defined variables used in there are pulled at run inception rather than real time. The template isnt updated with changes that might occur to user variables during a run.. eg a timestamp etc..

Error InMemoryJavaCompiler

I have been using pepperbox on my workstation (Windows10) without issues. Now I was ready to move the JMeter test to a test server witch is Windows 2012 R2.
I have copied everything I needed on the server and installed jdk 1.8 (jdk-8u161-windows-x64). I created the JAVA_HOME env variable and adding it to PATH with \bin
Now when I run my test in jmeter on the sever I get this error.

Feb 01, 2018 2:22:28 PM com.gslab.pepper.input.SchemaTranslator getPlainTextMsgIterator
SEVERE: Failed to compileSchemaClass classjava.lang.NullPointerException
at com.gslab.pepper.input.compile.InMemoryJavaCompiler.compileSchemaClass(InMemoryJavaCompiler.java:39)
at com.gslab.pepper.input.SchemaTranslator.getPlainTextMsgIterator(SchemaTranslator.java:47)
at com.gslab.pepper.input.SchemaProcessor.getPlainTextMessageIterator(SchemaProcessor.java:36)
at com.gslab.pepper.loadgen.impl.PlaintTextLoadGenerator.(PlaintTextLoadGenerator.java:34)
at com.gslab.pepper.config.plaintext.PlainTextConfigElement.iterationStart(PlainTextConfigElement.java:53)
at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:393)
at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:385)
at org.apache.jmeter.control.GenericController.next(GenericController.java:158)
at org.apache.jmeter.control.LoopController.next(LoopController.java:123)
at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:87)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
at java.lang.Thread.run(Unknown Source)

I see that this points out to this returning NULL I think
//Custom file manager takes source code object and classloader
ExtendedStandardJavaFileManager fileManager = new ExtendedStandardJavaFileManager(compiler.getStandardFileManager(null, null, null), compiledCode, dynamicClassLoader);

I run the jmeter with administrator privilege. I tried a lot of things. Do you have any ideas what that error might be.

Error when start in Jmeter windows 10

SEVERE: Failed to compileSchemaClass class
java.lang.NullPointerException
at com.gslab.pepper.input.compile.InMemoryJavaCompiler.compileSchemaClass(InMemoryJavaCompiler.java:39)
at com.gslab.pepper.input.SchemaTranslator.getPlainTextMsgIterator(SchemaTranslator.java:47)
at com.gslab.pepper.input.SchemaProcessor.getPlainTextMessageIterator(SchemaProcessor.java:36)
at com.gslab.pepper.loadgen.impl.PlaintTextLoadGenerator.(PlaintTextLoadGenerator.java:34)
at com.gslab.pepper.config.plaintext.PlainTextConfigElement.iterationStart(PlainTextConfigElement.java:53)
at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:405)
at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:397)
at org.apache.jmeter.control.GenericController.next(GenericController.java:158)
at org.apache.jmeter.control.LoopController.next(LoopController.java:123)
at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:87)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:239)
at java.lang.Thread.run(Unknown Source)

SEQUENCE is reset only upon JVM restart

Would be nice if you can fix the following:

  • reset the SEQUENCEs (preferably they should auto-reset on test plan restart from JMeter GUI, but they won't, because JMeter's JVM is still utilized and the SEQUENCES are in a static map)
  • get current value of a SEQUENCE (needed for example to get a counter of total sent messages for assertions)

PlainText Config Templates with functions fail JSONLint validation

I like to validate my JSON first with jsonlint.com but when it contains functions that have quoted parameters (like SEQUENCE) it fails validation. For example,
"messageId":{{SEQUENCE("messageId", 1, 1)}}
fails because the braces are reserved characters in JSON and confuse the validator.
If i try to quote the value, like
"messageId":"{{SEQUENCE("messageId", 1, 1)}}"
it also fails because it thinks the quotes are being closed at the wrong point.
I've tried escaping the double quotes around "messageId", and I've tried escaping the braces, but nothing works.
Is it possible to have functions support single quotes around the parameters?

Push compiled JARs to maven central repo?

Is it expected that users will have to compile the JAR themselves or find a precompiled JAR somewhere like https://github.com/raladev/load/blob/master/JARs/pepper-box-1.0.jar?

Like https://github.com/BrightTag/kafkameter/issues/10, it would be nice if users could just pull from maven if they don't need latest & greatest or need to do their own customizations.

btw, came across this project from https://www.blazemeter.com/blog/apache-kafka-how-to-load-test-with-jmeter

Jmeter Error: PlaintTextLoadGenerator: Please make sure that expressions functions are already defined and parameters are correctly passed

Hi Team,
I am facing issue in Jmeter script for pepper box Kafka request. Below is the error i am getting.
**Jmeter Error: PlaintTextLoadGenerator: Please make sure that expressions functions are already defined and parameters are correctly passed.
com.gslab.pepper.exception.PepperBoxException: java.lang.NullPointerException

Kindly suggest why i am getting this error and what is the solution for it.

getting unable to resolve class KafkaConsumer

I am getting an error "unable to resolve class KafkaConsumer" when running a groovy script in JSR223 Sampler. Below is the script for reference. Please suggest what can be the possible solution for this. Also, if possible please provide jar for com.gslab.pepper.Message

Properties props = new Properties();
props.put("bootstrap.servers", "localhost:9092");
props.put("group.id", group);
props.put("enable.auto.commit", "true");
props.put("auto.commit.interval.ms", "1000");
props.put("session.timeout.ms", "30000");
props.put("key.deserializer",
"org.apache.kafka.common.serializa-tion.StringDeserializer");
props.put("value.deserializer",
"org.apache.kafka.common.serializa-tion.StringDeserializer");
KafkaConsumer<String, String> consumer = new KafkaConsumer<String, String>(props);

  consumer.subscribe(Arrays.asList(topic));

long t = System.currentTimeMillis();
long end = t + 5000;
f = new FileOutputStream(".\data.csv", true);
p = new PrintStream(f);
while (System.currentTimeMillis()<end)
{
ConsumerRecords<String, String> records = consumer.poll(100);
for (ConsumerRecord<String, String> record : records)
{
p.println( "offset = " + record.offset() +" value = " + record.value());
}
consumer.commitSync();
}
consumer.close();
p.close();
f.close();

Where's is the keyed message feature?

I don't know what Im doing wrong but I can't see the keyed message feature.

Here the step I did.

git clone https://github.com/GSLabDev/pepper-box.git
cd pepper-box/
mvn clean install -Djmeter.version=3.0 -Dkafka.version=0.9.0.1

Build Success
I copy the ./target/pepper-box-1.0.jar in JMETER_HOME/lib/ext/

I start Jmeter add a Sampler Java Request choose PepperBox as classname.
Now I don't see the propertie of keyed.message

Here is the properties I see.
`

bootstrap.servers  
zookeeper.servers  
kafka.topic.name  
key.serializer org.apache.kafka.common.serialization.StringSerializer
value.serializer org.apache.kafka.common.serialization.StringSerializer
compression.type none
batch.size 16384
linger.ms 0
buffer.memory 33554432
acks 1
send.buffer.bytes 131072
receive.buffer.bytes 32768
security.protocol PLAINTEXT
message.placeholder.key MESSAGE
kerberos.auth.enabled NO
java.security.auth.login.config  
java.security.krb5.conf  
sasl.kerberos.service.name kafka
sasl.mechanism GSSAPI
ssl.enabled NO
ssl.key.password  
ssl.keystore.location  
ssl.keystore.password  
ssl.truststore.location  
ssl.truststore.password  

`
I tried with Jmeter 3.0 and 3.3

From this issue I was sure it was in the main branch.
#10

Limit number of messages per second:

Hi,

Is there a way we can limit the number of messages we are pushing to the topic ? I looked at the options I could find a proper setting for it.

Thanks.

Getting KafkaProducer: Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms in jmeter log

Hi ,
I am new to Kafka but we have a requirement of performance testing for Kafka topic. I created Jmeter script using pepper box Jar file batch - Jmeter3.2_10.2. But we are getting "KafkaProducer: Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms " info in Jmeter log file. and data is not inserting to the required topic. Kindly let me know how can we resolve this issue.
Other info:
Jmeter 3.2
Kafka 0.10.1.0

  • Is kafka version difference ( 10.2 & 10.1) causing issue?
    Thanks,

unable to enter fields with "_" values

Hi,
This plugin is working fine for unsecured cluster. But when we try to test it with secured cluster i.e. Authentication with Kerberos Active Directory and Encryption with Truststore this plugin is not working. When I try to enter new value using "_" for ssl properties and click on save button. It automatically gets deleted. Please help us on this issue.

I'm using Jmeter 5.1 and Kafka 2.0

Thanks.

Kafka Version 0.10.0.1 supported?

Hello,

The Kafka service I am using pepper-box to test has been upgraded to 0.10.0.1 and the plugin is not working anymore. Can anyone confirm that 0.10.0.1 is not supported and if there are any plans for this support?

please add support for new kafka versions

i see that this project is based on Kafka 0.9.0.1 which is quite old version of kafka and kafka has evolved a long way since then. it will be a good idea if those latest versions of kafka is also supported here.

Serialized message throws error

build jar from mvn clean install -Djmeter.version=3.0 -Dkafka.version=0.9.0.1

dropped it into the lib/ext of jmeter 3.0

using the jmx from the wiki non serialized produces kafka messages good ( with plain Text java request and Kafka PlainText Load Generator Config ) Toggling off the previous elements and on the serialized and on the serialized java request and on the Kafka Serialized Load Generator Config and trying to do 1 message I get the following in the log ( using jdk1.8.0_171 java)

2018/06/21 04:33:00 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started
2018/06/21 04:33:00 INFO - jmeter.threads.JMeterThread: Thread started: Thread Group 1-1
2018/06/21 04:33:00 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NoClassDefFoundError: org/apache/commons/lang/StringUtils
at com.gslab.pepper.input.SchemaParser.getProcessedSchema(SchemaParser.java:121)
at com.gslab.pepper.input.SchemaProcessor.getSerializedMessageIterator(SchemaProcessor.java:51)
at com.gslab.pepper.loadgen.impl.SerializedLoadGenerator.(SerializedLoadGenerator.java:37)
at com.gslab.pepper.config.serialized.SerializedConfigElement.iterationStart(SerializedConfigElement.java:51)
at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:405)
at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:397)

Also on dropping in a commons long 2.6 gives the error ..

Writing log file to: /root/apache-jmeter-3.0/bin/jmeter.log
/MessageIterator1529591295958.java:1: error: cannot find symbol
import java.util.Iterator;import static com.gslab.pepper.input.FieldDataFunctions.;import static com.gslab.pepper.input.CustomFunctions.;public class MessageIterator1529591295958 implements Iterator { private static com.gslab.pepper.Message serializedObj = new com.gslab.pepper.Message(); @OverRide public boolean hasNext() { return true; } @OverRide public Object next() { serializedObj.setMessageId(SEQUENCE("messageId", 1, 1));
^
symbol: class Message
location: package com.gslab.pepper
/MessageIterator1529591295958.java:1: error: cannot find symbol
import java.util.Iterator;import static com.gslab.pepper.input.FieldDataFunctions.;import static com.gslab.pepper.input.CustomFunctions.;public class MessageIterator1529591295958 implements Iterator { private static com.gslab.pepper.Message serializedObj = new com.gslab.pepper.Message(); @OverRide public boolean hasNext() { return true; } @OverRide public Object next() { serializedObj.setMessageId(SEQUENCE("messageId", 1, 1));
^
symbol: class Message
location: package com.gslab.pepper

NullPointerException while running a test plan with Jmeter - Version 5.1 and Kafka 2.2.0 despite the System variable only pointing JDK and not the JRE

NullPointerException while running a test plan with Jmeter - Version 5.1 and Kafka 2.2.0

With previous issues, the issue was found to be resolved when the JAVA_HOME was set to be JDK instead of JRE. We have already ensured that the system variabls are only pointing to JDK and not the JRE but the issue persists.

ERROR c.g.p.l.i.PlaintTextLoadGenerator: Please make sure that expressions functions are already defined and parameters are correctly passed.
com.gslab.pepper.exception.PepperBoxException: java.lang.NullPointerException
at com.gslab.pepper.input.SchemaTranslator.getPlainTextMsgIterator(SchemaTranslator.java:54) ~[pepper-box-1.0.jar:?]
at com.gslab.pepper.input.SchemaProcessor.getPlainTextMessageIterator(SchemaProcessor.java:36) ~[pepper-box-1.0.jar:?]
at com.gslab.pepper.loadgen.impl.PlaintTextLoadGenerator.(PlaintTextLoadGenerator.java:34) [pepper-box-1.0.jar:?]
at com.gslab.pepper.config.plaintext.PlainTextConfigElement.iterationStart(PlainTextConfigElement.java:53) [pepper-box-1.0.jar:?]
at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:399) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:391) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.control.GenericController.next(GenericController.java:160) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.control.LoopController.next(LoopController.java:135) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:87) [ApacheJMeter_core.jar:5.1.1 r1855137]
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:251) [ApacheJMeter_core.jar:5.1.1 r1855137]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_211]
Caused by: java.lang.NullPointerException
at com.gslab.pepper.input.compile.InMemoryJavaCompiler.compileSchemaClass(InMemoryJavaCompiler.java:39) ~[pepper-box-1.0.jar:?]
at com.gslab.pepper.input.SchemaTranslator.getPlainTextMsgIterator(SchemaTranslator.java:47) ~[pepper-box-1.0.jar:?]
... 10 more

Input external parameters from CSV Data Set Config

Hello, me and my team are struggling to send an event to Kafka using an external parameter defined by CSV input file through CSV Data Set Config.
Is there any way to use a parsed attribute value inside Kafka Load Generators? We could not find a solution, is this function supported?

Thanks,
Tiago

Facing Error with Plugin - "Failed to create PlaintTextLoadGenerator instance"

Hi team,

I tried to add this plugin and followed the exact process referred on GIT. I am seeing an error when trying to trigger the test. Attached are my configuration snapshots and jmeter log with error.

I also tried the same with sample JMX given in the repo and observed the same error. While i tried with a custom template, i also tried with plain text and other formats which did not work.

Can you please help me here?

image
image
jmeterLog.txt

MessageIterator1498469983691.java:1: error: constant string too long

When trying to use a 114k Json Schema Template and the "Pepper-Box Plaintext Config" I get an exception

2017-06-26 03:39:44,266 ERROR o.a.j.JMeter: Uncaught exception: 
java.lang.ClassFormatError: Truncated class file
	at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_91]
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763) ~[?:1.8.0_91]
	at java.lang.ClassLoader.defineClass(ClassLoader.java:642) ~[?:1.8.0_91]
	at com.gslab.pepper.input.compile.DynamicClassLoader.findClass(DynamicClassLoader.java:59) ~[pepper-box-1.0.jar:?]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_91]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_91]
	at com.gslab.pepper.input.compile.InMemoryJavaCompiler.compileSchemaClass(InMemoryJavaCompiler.java:46) ~[pepper-box-1.0.jar:?]
	at com.gslab.pepper.input.SchemaTranslator.getPlainTextMsgIterator(SchemaTranslator.java:47) ~[pepper-box-1.0.jar:?]
	at com.gslab.pepper.input.SchemaProcessor.getPlainTextMessageIterator(SchemaProcessor.java:36) ~[pepper-box-1.0.jar:?]
	at com.gslab.pepper.loadgen.impl.PlaintTextLoadGenerator.<init>(PlaintTextLoadGenerator.java:34) ~[pepper-box-1.0.jar:?]
	at com.gslab.pepper.config.plaintext.PlainTextConfigElement.iterationStart(PlainTextConfigElement.java:53) ~[pepper-box-1.0.jar:?]
	at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:393) ~[ApacheJMeter_core.jar:3.2 r1790748]
	at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:385) ~[ApacheJMeter_core.jar:3.2 r1790748]
	at org.apache.jmeter.control.GenericController.next(GenericController.java:158) ~[ApacheJMeter_core.jar:3.2 r1790748]
	at org.apache.jmeter.control.LoopController.next(LoopController.java:123) ~[ApacheJMeter_core.jar:3.2 r1790748]
	at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:87) ~[ApacheJMeter_core.jar:3.2 r1790748]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:252) ~[ApacheJMeter_core.jar:3.2 r1790748]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_91]
2017-06-26 03:39:44,270 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2017-06-26 03:39:44,270 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

and the following goes to the Jmeter Console

/MessageIterator1498469983691.java:1: error: constant string too long
import java.util.Iterator;import static com.gslab.pepper.input.FieldDataFunctions.*;import static com.gslab.pepper.input.CustomFunctions.*;public class MessageIterator1498469983691
...

maybe this is an issue with InMemoryJavaCompiler but that isn't that large a message especially when trying to test larger messages.

any thoughts would be appreciated before I start digging through source code.

thank you

Exception while connecting kafka server through Pepperbox

I am using pepprBox Sample in JMeter to connect kafka server and sending messages on topic.
Application team shared two JKS certificate along with password to connect Kafka server.
For this, I have enabled keystore property in system.properties file:
javax.net.ssl.keystore=
javax.net.ssl.keystorepassword=

and index entry in jmeter.properties
https.keystoreStartIndex=0
https.keystoreEndIndex=1

I specified Broker , Zookeeper and Topic name with "SSL"security protocol.
But not able to connect kafka server and getting below exception:
--Error While calling watcher
--Java.net.connectException: connection Refused

Please share your best help to correct me if i am doing anything incorrect.

Compile for Windows 7, JMeter 3.3 and Kafka 0.11.0.0, NullPointerException when running test plan

  1. System: Windows 7
  2. JMeter version: 3.3
  3. Kafka version: 0.11.0.1

Error log:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:testCompile (default-testCompile) on project pepper-box: Compilation failure
[ERROR] /D:/pepper-box-master/src/test/java/com/gslab/pepper/test/PepperBoxConfigElementTest.java:[12,28] package net.didion.jwnl.data does not exist

Tried with Jmeter version 3.0 and Kafka 0,9.0.1 and it worked fine.

com.gslab.pepper.loadgen.impl.PlaintTextLoadGenerator: Please make sure that expressions functions are already defined and parameters are correctly passed. com.gslab.pepper.exception.PepperBoxException: java.lang.NullPointerException

Hi there,

We are working on POC for load testing Kafka Producer using Jmeter. Kafka version we are using is 2.2.0 and Jmeter version as 3.0 and Java version 1.8.202. But when I am executing Java request in Jmeter I see below error:
I configured all things correctly as mentioned here in this plugin thread. Am I missing anything? Can someone help me fix this issue? I suspect it might be Kafka version issue. As all the version mentioned here in Pepper-box is Kafka 0.1.XX.
9/07/16 23:55:44 INFO - jmeter.engine.StandardJMeterEngine: All thread groups have been started
2019/07/16 23:55:44 INFO - jmeter.threads.JMeterThread: Thread started: Thread Group 1-1
2019/07/16 23:55:44 ERROR - com.gslab.pepper.loadgen.impl.PlaintTextLoadGenerator: Please make sure that expressions functions are already defined and parameters are correctly passed. com.gslab.pepper.exception.PepperBoxException: java.lang.NullPointerException
at com.gslab.pepper.input.SchemaTranslator.getPlainTextMsgIterator(SchemaTranslator.java:54)
at com.gslab.pepper.input.SchemaProcessor.getPlainTextMessageIterator(SchemaProcessor.java:36)
at com.gslab.pepper.loadgen.impl.PlaintTextLoadGenerator.(PlaintTextLoadGenerator.java:34)
at com.gslab.pepper.config.plaintext.PlainTextConfigElement.iterationStart(PlainTextConfigElement.java:53)
at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:405)
at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:397)
at org.apache.jmeter.control.GenericController.next(GenericController.java:158)
at org.apache.jmeter.control.LoopController.next(LoopController.java:123)
at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:87)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:239)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at com.gslab.pepper.input.compile.InMemoryJavaCompiler.compileSchemaClass(InMemoryJavaCompiler.java:39)
at com.gslab.pepper.input.SchemaTranslator.getPlainTextMsgIterator(SchemaTranslator.java:47)
... 10 more

2019/07/16 23:55:44 ERROR - com.gslab.pepper.config.plaintext.PlainTextConfigElement: Failed to create PlaintTextLoadGenerator instance com.gslab.pepper.exception.PepperBoxException: com.gslab.pepper.exception.PepperBoxException: java.lang.NullPointerException
at com.gslab.pepper.loadgen.impl.PlaintTextLoadGenerator.(PlaintTextLoadGenerator.java:37)
at com.gslab.pepper.config.plaintext.PlainTextConfigElement.iterationStart(PlainTextConfigElement.java:53)
at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:405)
at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:397)
at org.apache.jmeter.control.GenericController.next(GenericController.java:158)
at org.apache.jmeter.control.LoopController.next(LoopController.java:123)
at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:87)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:239)
at java.lang.Thread.run(Unknown Source)
Caused by: com.gslab.pepper.exception.PepperBoxException: java.lang.NullPointerException
at com.gslab.pepper.input.SchemaTranslator.getPlainTextMsgIterator(SchemaTranslator.java:54)
at com.gslab.pepper.input.SchemaProcessor.getPlainTextMessageIterator(SchemaProcessor.java:36)
at com.gslab.pepper.loadgen.impl.PlaintTextLoadGenerator.(PlaintTextLoadGenerator.java:34)
... 8 more
Caused by: java.lang.NullPointerException
at com.gslab.pepper.input.compile.InMemoryJavaCompiler.compileSchemaClass(InMemoryJavaCompiler.java:39)
at com.gslab.pepper.input.SchemaTranslator.getPlainTextMsgIterator(SchemaTranslator.java:47)
... 10 more

2019/07/16 23:55:44 ERROR - jmeter.threads.JMeterThread: Test failed! java.lang.NullPointerException
at com.gslab.pepper.config.plaintext.PlainTextConfigElement.iterationStart(PlainTextConfigElement.java:63)
at org.apache.jmeter.control.GenericController.fireIterationStart(GenericController.java:405)
at org.apache.jmeter.control.GenericController.fireIterEvents(GenericController.java:397)
at org.apache.jmeter.control.GenericController.next(GenericController.java:158)
at org.apache.jmeter.control.LoopController.next(LoopController.java:123)
at org.apache.jmeter.threads.AbstractThreadGroup.next(AbstractThreadGroup.java:87)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:239)
at java.lang.Thread.run(Unknown Source)

Failed to send message. Kafka 1.0.0, Jmeter 3.0

Version: commit e66ece5
Jmeter: 3.0
Kafka: 1.0.0
openjdk version "1.8.0_151"

Use "Pepper-Box PlainText Config"
key: test
schema template: {"foo": "bar"}

Logs:
2018/03/08 15:07:08 ERROR - com.gslab.pepper.sampler.PepperBoxKafkaSampler: Failed to send message java.lang.NullPointerException at com.gslab.pepper.sampler.PepperBoxKafkaSampler.runTest(PepperBoxKafkaSampler.java:179) at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:196) at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:465) at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:410) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:241) at java.lang.Thread.run(Thread.java:748)

2018/03/08 15:07:08 ERROR - jmeter.threads.JMeterThread: Error while processing sampler 'Java Request' : java.lang.NullPointerException at org.apache.jmeter.samplers.SampleResult.setResponseData(SampleResult.java:704) at com.gslab.pepper.sampler.PepperBoxKafkaSampler.runTest(PepperBoxKafkaSampler.java:185) at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:196) at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:465) at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:410) at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:241) at java.lang.Thread.run(Thread.java:748)

In Kafka receives "null" instead of {"foo": "bar"}

Also if specify zookeeper:
2018/03/08 15:43:01 ERROR - org.apache.zookeeper.ClientCnxn: Error while calling watcher java.lang.NullPointerException at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:522) at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:498)

SchemaParser.java:[7,31] package org.apache.commons.lang does not exist

Hello guys,

I'd like to use JMeter to test Kafka 2.2.0 or even 2.3.0.
I tried to compile with Maven but get error.

[ERROR] /[path]/pepper-box/src/main/java/com/gslab/pepper/input/SchemaParser.java:[7,31] package org.apache.commons.lang does not exist

I tried like so.

mvn clean install -Djmeter.version=5.2.1 -Dkafka.version=2.2.0

I used the jmeter5.0_kafka1.1.0 branch but it did not work.

Can we even use this plug-in for Kafka 2.0 and above or is it for Kafka 1.x.x only?

Best regards
Skrzetuski

Kafka Consumer throws NullPointerExcception (ERROR o.a.z.ClientCnxn: Error while calling watcher )

The version used:
JMeter Version: 5.0
Kafka version: 2.0

Consumer Configurations:

import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.clients.consumer.KafkaConsumer;
import org.apache.kafka.common.serialization.StringDeserializer;
import java.util.Arrays;
import java.util.Properties;

Properties props = new Properties();
props.put("bootstrap.servers", "localhost:9092");
props.put("group.id", "techforum-group-perftest");
props.put("enable.auto.commit", "true");
props.put("auto.commit.interval.ms", "1000");
props.put("session.timeout.ms", "30000");
props.put("key.deserializer",    
   "org.apache.kafka.common.serialization.StringDeserializer");
props.put("value.deserializer", 
   "org.apache.kafka.common.serialization.StringDeserializer");
KafkaConsumer<String, String> consumer = new KafkaConsumer<String, String>(props);

consumer.subscribe(Arrays.asList("temp-topic"));
System.out.println("Subscribed to topic temp-topic");
int i = 0;
   
while (true) {
   ConsumerRecords<String, String> records = consumer.poll(100);
for (ConsumerRecord<String, String> record : records)
   System.out.printf("offset = %d, key = %s, value = %s\n", 
   record.offset(), record.key(), record.value());
}

Getting following error while listenening to the messages.

2018-11-11 17:46:18,875 INFO o.a.z.ClientCnxn: Socket connection established to localhost/127.0.0.1:2181, initiating session
2018-11-11 17:46:18,915 INFO o.a.z.ClientCnxn: Session establishment complete on server localhost/127.0.0.1:2181, sessionid = 0x16704e8ff960003, negotiated timeout = 10000
2018-11-11 17:46:18,919 ERROR o.a.z.ClientCnxn: Error while calling watcher 
java.lang.NullPointerException: null
	at org.apache.zookeeper.ClientCnxn$EventThread.processEvent(ClientCnxn.java:533) [pepper-box-1.0.jar:?]
	at org.apache.zookeeper.ClientCnxn$EventThread.run(ClientCnxn.java:508) [pepper-box-1.0.jar:?]```

I tried to build the pepper-box jat but the test PepperBoxConfigElementTest.java fails with same error. 

In Pepper-Box PlainText Config parameterisation is not working for mutltiple user or iterations

In Pepper-Box PlainText Config when we parameterisation is not working with threads and iteration.
Initially defined my_counter as user defined value = 111111

Java request sampler always sends same value for all threads and iterations value =111111
{
"Myaccount": {
"MyaccountType": "OPEN",
"AccountId": "${__intSum(${my_counter},1,my_counter)}",
"companyName": null
}
}


Even i tried JSR Preprocessor to increment using

long my_counter = Long.parseLong(vars.get("my_counter"));
my_counter = my_counter + 1;
vars.put("my_counter", String.valueOf(my_counter));

Java request sampler it sends same value of what is being defined in User defined variable =111111
{
"Myaccount": {
"MyaccountType": "OPEN",
"AccountId": "${my_counter}",
"companyName": null
}
}

Dynamic parameterisation is not working.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.