flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zhun Shen <shenzhunal...@gmail.com>
Subject Kafka Test Error
Date Wed, 30 Mar 2016 07:21:52 GMT
Hi there,

flink version: 1.0.0
kafka version: 0.9.0.0
env: local

I run the script below:
./bin/flink run -c com.test.flink.FlinkTest test.jar --topic nginx-logs --bootstrap.servers
localhost:9092 --zookeeper.connect localhost:2181 --group.id myGroup --partition.assignment.strategy
round robin

But I got the error:
ava.lang.NoSuchMethodError: org.apache.kafka.clients.consumer.KafkaConsumer.partitionsFor(Ljava/lang/String;)Ljava/util/List;
	at org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer09.<init>(FlinkKafkaConsumer09.java:194)
	at org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer09.<init>(FlinkKafkaConsumer09.java:164)
	at org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer09.<init>(FlinkKafkaConsumer09.java:131)


The code as  below:
        DataStream<String> messageStream = env.addSource(new FlinkKafkaConsumer09<>("nginx-logs",
new SimpleStringSchema(),parameterTool.getProperties()));
        messageStream.rebalance().map(new MapFunction<String, String>() {

            @Override
            public String map(String value) throws Exception {
                return "Kafka and Flink says: " + value;
            }
        }).print();


I check the error with google, but it shows that it is a method of kafka 0.9.01. Any idea?
Thanks.


Mime
View raw message