flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Balaji Rajagopalan <balaji.rajagopa...@olacabs.com>
Subject Re: Kafka Test Error
Date Wed, 30 Mar 2016 07:42:47 GMT
I have tested kafka 0.8.0.2 with flink 1.0.0 and it works for me. Can't
talk about kafka 0.9.0.1.

On Wed, Mar 30, 2016 at 12:51 PM, Zhun Shen <shenzhunallen@gmail.com> wrote:

> 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