Skip to content

An example of a producer Java application that sends events to an Apache Kafka broker

License

Notifications You must be signed in to change notification settings

lealceldeiro/kafkaproducer

Repository files navigation

Example Java application: Apache Kafka Producer

An example of a producer Java application that sends events to an Apache Kafka broker

Requirements

Build and run

  • Run ./mvnw compile exec:java -Dexec.mainClass="com.kafkaexamples.kafkaproducer.KafkaProducerMain" -Dexec.args="localhost:9094 topic1"
  • Start writing messages (strings) to be sent to the configured broker
  • Type /exit and hit enter to stop the program

Note: replace the provided arguments with the correct values for your Kafka cluster.

About

An example of a producer Java application that sends events to an Apache Kafka broker

Topics

Resources

License

Stars

Watchers

Forks

Languages