Dear Kafka dev team!

 

I’m implementing a data stream processor with Apache Kafka for my bachelor’s
thesis and right now I’m struggling with trying to get the Kafka Server
started with Java.

 

A short summary of what I’m doing currently:

1.      Start ZooKeeper (manually via terminal).
2.      Start Kafka Server (manually via terminal).
3.      Create Kafka Topic (manually via terminal, although it would be
auto-created by the producer anyway).
4.      Run Kafka Producer written with the Kafka Clients API in Java.
5.      Run Kafka Consumer written with the Kafka Clients API in Java.

 

To further automatize the testing process with jUnit, I’d like to be able to
start ZooKeeper and the Kafka Server with Java too, as I do with the
producer and the consumer.

This should be possible, according to some examples I found online, using
the Scala source of Kafka (not Kafka Clients!):
http://www.programcreek.com/java-api-examples/index.php?api=kafka.server.Kaf
kaServer

But whenever I try to create a new KafkaServer object, I get an error
(please see attached error.png).

 

Here are my maven dependencies:

<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka-clients</artifactId>
    <version>0.10.1.1</version>
</dependency>
<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka-streams</artifactId>
    <version>0.10.1.1</version>
</dependency>
<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka_2.11</artifactId>
    <version>0.10.1.1</version>
</dependency>

 

I Somehow have the feeling I’m missing something crucial and easy-to-fix.
Neither a lot of google searches nor playing around with the parameters
(time, threadNamePrefix, kafkaMetricsReporters) provided to the KafkaServer
constructor could resolve my issue.

Could you please help me? I’m stuck and don’t know what to do anymore.

Thank you in advance.

 

Best regards,

Stefan Kölbl

Reply via email to