I am getting the below exception when I try to create a kafka streams instance.Exception in thread "main" java.lang.NoSuchMethodError: org.apache.kafka.common.metrics.Sensor.add(Lorg/apache/kafka/common/MetricName;Lorg/apache/kafka/common/metrics/MeasurableStat;)Z
at org.apache.kafka.streams.processor.internals.metrics.StreamsMetricsImpl.<init>(StreamsMetricsImpl.java:64)
at org.apache.kafka.streams.processor.internals.StreamThread$StreamsMetricsThreadImpl.<init>(StreamThread.java:525)
at org.apache.kafka.streams.processor.internals.StreamThread.create(StreamThread.java:618)
at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:706)
at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:624)
at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:534)
I am trying to run the WordCountDemo scala example in intellij but unable to do so. I have org.apache.kafka:kafka-streams-scala_2.11:2.1.0
and org.apache.kafka:kafka-clients:1.0.2
dependencies included in my project and see the jars imported.
The answer was already found in the comments by @Matthias
You will need same client version org.apache.kafka:kafka-clients:2.1.0 that matches KafkaStreams version
This was confirmed to work for the asker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With