/kafka-producer-consumer-java-example

A java example program for Producer/Consumer in a Kafka cluster

Primary LanguageJava

Apache-Kafka-Producer-Consumer-Example

Requirement

  • maven
  • java 1.8

To build the jar file

mvn clean package

To run the program as producer

java -jar kafka-producer-consumer-1.0-SNAPSHOT.jar producer broker:port

To run program as consumer

java -jar kafka-producer-consumer-1.0-SNAPSHOT.jar consumer broker:port