Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue]: Simple Key Config serializer exception #424

Open
2 tasks done
CROprogrammer opened this issue Nov 17, 2023 · 1 comment
Open
2 tasks done

[Issue]: Simple Key Config serializer exception #424

CROprogrammer opened this issue Nov 17, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@CROprogrammer
Copy link

What happened?

When I try to send key of type integer and I use org.apache.kafka.common.serialization.IntegerSerializer, then I get error as specified below. I get an error like that for any serializer other than StringSerializer.

Simple Test Plan 2.zip

KloadGen Version

5.6.6

Relevant log output

2023-11-17 10:24:48,346 ERROR o.a.j.t.JMeterThread: Error while processing sampler: 'Java Request'.
org.apache.kafka.common.errors.SerializationException: Can't convert key of class java.lang.String to class org.apache.kafka.common.serialization.IntegerSerializer specified in key.serializer
	at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:940) ~[kloadgen-5.6.6.jar:?]
	at org.apache.kafka.clients.producer.KafkaProducer.send(KafkaProducer.java:905) ~[kloadgen-5.6.6.jar:?]
	at com.sngular.kloadgen.sampler.KafkaProducerSampler.runTest(KafkaProducerSampler.java:159) ~[kloadgen-5.6.6.jar:?]
	at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:197) ~[ApacheJMeter_java.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:651) ~[ApacheJMeter_core.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:570) ~[ApacheJMeter_core.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:501) ~[ApacheJMeter_core.jar:5.5]
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:268) ~[ApacheJMeter_core.jar:5.5]
	at java.lang.Thread.run(Thread.java:1623) ~[?:?]
Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Integer (java.lang.String and java.lang.Integer are in module java.base of loader 'bootstrap')
	at org.apache.kafka.common.serialization.IntegerSerializer.serialize(IntegerSerializer.java:19) ~[kloadgen-5.6.6.jar:?]
	at org.apache.kafka.common.serialization.Serializer.serialize(Serializer.java:62) ~[kloadgen-5.6.6.jar:?]
	at org.apache.kafka.clients.producer.KafkaProducer.doSend(KafkaProducer.java:937) ~[kloadgen-5.6.6.jar:?]
	... 8 more
2023-11-17 10:24:48,346 INFO o.a.j.t.JMeterThread: Thread is done: Thread Group 1-1
2023-11-17 10:24:48,346 INFO o.a.j.t.JMeterThread: Thread finished: Thread Group 1-1
2023-11-17 10:24:48,346 INFO o.a.j.e.StandardJMeterEngine: Notifying test listeners of end of test
2023-11-17 10:24:48,346 INFO o.a.k.c.p.KafkaProducer: [Producer clientId=] Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms.
2023-11-17 10:24:48,348 INFO o.a.k.c.m.Metrics: Metrics scheduler closed
2023-11-17 10:24:48,348 INFO o.a.k.c.m.Metrics: Closing reporter org.apache.kafka.common.metrics.JmxReporter
2023-11-17 10:24:48,349 INFO o.a.k.c.m.Metrics: Metrics reporters closed
2023-11-17 10:24:48,349 INFO o.a.k.c.u.AppInfoParser: App info kafka.producer for  unregistered
2023-11-17 10:24:48,349 INFO o.a.j.g.u.JMeterMenuBar: setRunning(false, *local*)

Have you added your JMX Testplan or a replica?

  • I have added a JMX testplan

Have you added your Schema or a replica?

  • I have added the Schema
@jemacineiras jemacineiras self-assigned this Nov 17, 2023
@jemacineiras jemacineiras added the bug Something isn't working label Nov 17, 2023
@jemacineiras
Copy link
Contributor

Hi @CROprogrammer,

I will take a look at it.

Cheers

jemacineiras added a commit that referenced this issue Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants