Kafka Maven Dependencies

22,441

If you want to use the latest producer and consumer API then the correct Maven coordinates are:

<dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka-clients</artifactId>
    <version>0.9.0.0</version>
</dependency>

See the API documentation for more.

Share:
22,441
nikel
Author by

nikel

Another guy who like programming:P...B.Tech,Computer Science.I believe that Programming is the art of making perfect things.

Updated on February 18, 2020

Comments

  • nikel
    nikel about 4 years

    What's the difference between the below two dependencies? Do i really need the first one to make a consumer or producer app?

    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka_2.9.2</artifactId>
            <version>0.8.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>0.8.2.1</version>
        </dependency>
    </dependencies>
    

    My Producer works fine with just the first one , but the consumer needs the second one.

    I had thought the "kafka-clients" artifact would work for both producer and consumer. But looks like "kafka.consumer.Consumer" comes from the other dependency. Why is there a difference?

    Also, why is the first artifact named as kafka_2.9.2? i.e why is a version identifier in the name?

  • nikel
    nikel about 8 years
    Updated the question to explain my doubt. Also, 9.0.0.0 is beta as of now.