You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by marzieh ghasemi <m....@gmail.com> on 2018/10/06 12:13:11 UTC

error in using kafka in flink

Hello

I downloaded kafka and followed these instructions step by step:

cd kafka_2.11-2

# start zookeeper server
./bin/zookeeper-server-start.sh ./config/zookeeper.properties

# start broker
./bin/kafka-server-start.sh ./config/server.properties

# create topic “test”
 ./bin/kafka-topics.sh --create --topic test --zookeeper localhost:2181
--partitions 1 --replication-f

# consume from the topic using the console producer
./bin/kafka-console-consumer.sh --topic test --zookeeper localhost:2181

# produce something into the topic (write something and hit enter)
./bin/kafka-console-producer.sh --topic test --broker-list localhost:9092

Also, I added "flink-connector-kafka" and "kafka-client" dependencies to
"pom.xml".
But while I run the example of "Monitoring the Wikipedia Edit Stream" I got
this error:
"cannot resolve symbol FlinkKafkaProducer08". I searched a lot but I could
n't find the solution.

Would you please help me?

Thank you in advance.

Re: error in using kafka in flink

Posted by marzieh ghasemi <m....@gmail.com>.
Hello

Thank you very much, but I imported "FlinkKafkaProducer09" and changed
"FlinkKafkaProducer08" to it. Then problem solved.

On Mon, Oct 8, 2018 at 3:39 PM Kostas Kloudas <k....@data-artisans.com>
wrote:

> Hi Marzieh,
>
> This is because of a mismatch between your Kafka version
> and the one your job assumes (0.8).
>
> You should use an older Kafka version (0.8) for the job to run
> out-of-the-box or update your job to use FlinkKafkaProducer011.
>
> Cheers,
> Kostas
>
> On Oct 6, 2018, at 2:13 PM, marzieh ghasemi <m....@gmail.com>
> wrote:
>
> Hello
>
> I downloaded kafka and followed these instructions step by step:
>
> cd kafka_2.11-2
>
> # start zookeeper server
> ./bin/zookeeper-server-start.sh ./config/zookeeper.properties
>
> # start broker
> ./bin/kafka-server-start.sh ./config/server.properties
>
> # create topic “test”
>  ./bin/kafka-topics.sh --create --topic test --zookeeper localhost:2181
> --partitions 1 --replication-f
>
> # consume from the topic using the console producer
> ./bin/kafka-console-consumer.sh --topic test --zookeeper localhost:2181
>
> # produce something into the topic (write something and hit enter)
> ./bin/kafka-console-producer.sh --topic test --broker-list localhost:9092
>
> Also, I added "flink-connector-kafka" and "kafka-client" dependencies to
> "pom.xml".
> But while I run the example of "Monitoring the Wikipedia Edit Stream" I
> got this error:
> "cannot resolve symbol FlinkKafkaProducer08". I searched a lot but I could
> n't find the solution.
>
> Would you please help me?
>
> Thank you in advance.
>
>
>

Re: error in using kafka in flink

Posted by Kostas Kloudas <k....@data-artisans.com>.
Hi Marzieh,

This is because of a mismatch between your Kafka version 
and the one your job assumes (0.8). 

You should use an older Kafka version (0.8) for the job to run 
out-of-the-box or update your job to use FlinkKafkaProducer011.
 
Cheers,
Kostas

> On Oct 6, 2018, at 2:13 PM, marzieh ghasemi <m....@gmail.com> wrote:
> 
> Hello
> 
> I downloaded kafka and followed these instructions step by step:
> 
> cd kafka_2.11-2
> 
> # start zookeeper server
> ./bin/zookeeper-server-start.sh ./config/zookeeper.properties
> 
> # start broker
> ./bin/kafka-server-start.sh ./config/server.properties 
> 
> # create topic “test”
>  ./bin/kafka-topics.sh --create --topic test --zookeeper localhost:2181 --partitions 1 --replication-f
> 
> # consume from the topic using the console producer
> ./bin/kafka-console-consumer.sh --topic test --zookeeper localhost:2181
> 
> # produce something into the topic (write something and hit enter)
> ./bin/kafka-console-producer.sh --topic test --broker-list localhost:9092
> 
> Also, I added "flink-connector-kafka" and "kafka-client" dependencies to "pom.xml". 
> But while I run the example of "Monitoring the Wikipedia Edit Stream" I got this error:
> "cannot resolve symbol FlinkKafkaProducer08". I searched a lot but I could n't find the solution. 
> 
> Would you please help me?
> 
> Thank you in advance.