Support Questions

Find answers, ask questions, and share your expertise

Flink Kafka Connector - java.lang.NoSuchMethodError

avatar
Contributor

Hello all,

 

I am trying to connect to Kafka from my Flink flow. I am using Flink version 1.14.3 and Kafka connector version: flink-connector-kafka-0.11_2.11:jar:1.11.6 (latest version in Maven repo). I am using FlinkKafkaConsumer011 in my code to create Kafka consumer to consume my kafka topics. However, when running Flink and deploying my flow, I see the below error thrown in logs:

 

java.lang.NoSuchMethodError: org.apache.flink.api.common.functions.RuntimeContext.getMetricGroup()Lorg/apache/flink/metrics/MetricGroup;
at org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumerBase.run(FlinkKafkaConsumerBase.java:762)
at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:110)
at org.apache.flink.streaming.api.operators.StreamSource.run(StreamSource.java:67)
at org.apache.flink.streaming.runtime.tasks.SourceStreamTask$LegacySourceFunctionThread.run(SourceStreamTask.java:323)

 

Appreciate any help on this.

 

- Prabu.

1 ACCEPTED SOLUTION

avatar
Contributor

I believe the Kafka connectors are discontinued from Flink 1.12. From release notes: In Flink 1.12 we removed the Kafka 0.10.x and 0.11.x connectors. Please use the universal Kafka connector which works with any Kafka cluster version after 0.10.2.x.

 

https://nightlies.apache.org/flink/flink-docs-release-1.14/release-notes/flink-1.12/#connectors-and-...

 

 

View solution in original post

2 REPLIES 2

avatar
Contributor

I believe the Kafka connectors are discontinued from Flink 1.12. From release notes: In Flink 1.12 we removed the Kafka 0.10.x and 0.11.x connectors. Please use the universal Kafka connector which works with any Kafka cluster version after 0.10.2.x.

 

https://nightlies.apache.org/flink/flink-docs-release-1.14/release-notes/flink-1.12/#connectors-and-...

 

 

avatar
Super Guru

@spserd ,

 

You're right. The Kafka 0.10 and 0.11 connectors are very old have been discontinued.

 

Cheers,

André

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.