pom文件
flink-connector-debezium:2.2.0
flink-connector-kafka_2.11:1.13.6
flink-connector-mysql-cdc:2.20
flink-connector-kafka_2.11:1.13.6
报错
java.lang.NoClassDefFoundError: org/apache/kafka/common/utils/ThreadUtils at com.ververica.cdc.debezium.internal.FlinkOffsetBackingStore.start(FlinkOffsetBackingStore.java:152) ~[flink-connector-debe
解决方案
添加kafka依赖
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>2.7.0</version>
</dependency>
代码案例
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.EnvironmentSettings;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
public class Testkafka {
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
StreamExecutionEnvironment env = StreamExecutionEnviron