简体   繁体   中英

flink read data from kafka

I write a simple example

val env = StreamExecutionEnvironment.getExecutionEnvironment
val properties = new Properties()
properties.setProperty("bootstrap.servers","xxxxxx")
properties.setProperty("zookeeper.connect","xxxxxx")
properties.setProperty("group.id", "caffrey")
val stream = env
  .addSource(new FlinkKafkaConsumer082[String]("topic", new SimpleStringSchema(), properties))
.print()

env.execute("Flink Kafka Example")

when I run this code I got an error like this:

[error] Class org.apache.flink.streaming.api.checkpoint.CheckpointNotifier not found - continuing with a stub.

I google this error and find CheckpointNotifier is an interface . I really don't understand where did I do wrong.

Since CheckpointNotifier is a class from an older Flink version, I suspect that you are mixing different Flink dependencies in your pom file.

Make sure all Flink dependencies have the same version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM