rollno748 / di-kafkameter

JMeter Plugin to load test Apache Kafka topics/brokers
34 stars 11 forks source link

Kafka Producer Sampler unable to run #12

Closed OcaeanYan closed 1 year ago

OcaeanYan commented 1 year ago

Use the same Variable name,but unable to run Error log: org.apache.kafka.common.KafkaException: Failed to construct kafka producer at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:468) at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:291) at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:318) at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:303) at com.di.jmeter.kafka.config.KafkaProducerConfig.testStarted(KafkaProducerConfig.java:81) at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:205) at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:382) at java.lang.Thread.run(Unknown Source) Caused by: org.apache.kafka.common.KafkaException: class org.apache.kafka.common.serialization.StringDeserializer is not an instance of org.apache.kafka.common.serialization.Serializer at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:405) at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:436) at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstance(AbstractConfig.java:421) at org.apache.kafka.clients.producer.KafkaProducer.(KafkaProducer.java:386) ... 7 more image image image image

rollno748 commented 1 year ago

Ah right - the issue is due to the serialization class try amending the serializer key in producer config to : org.apache.kafka.common.serialization.StringSerializer

and give it a try - if you still see the issue, can you share the jmeter.log file (you can remove the crucial info if something is in there)

rollno748 commented 1 year ago

I am releasing a newer version (v1.2) of this plugin - which is having the change for default serlializer key and value Also with some error handling changes.

meanwhile you can download it from the tags or from here: https://github.com/rollno748/di-kafkameter/releases/download/1.2/di-kafkameter-1.2.jar

Upon your confirmation, I will close this issue

OcaeanYan commented 1 year ago

I downloaded version 1.2, but the same problem still occurred. I will send jmeter.log to you jmeter.log

rollno748 commented 1 year ago

From the jmeter.log - which you have shared - I could see that your key serializer config is not an instance image

As I said earlier, you need to replace the key serializer in Producer config like below

image

Hopefully this will resolve your issue

OcaeanYan commented 1 year ago

Problem has been solved, thank you