No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Build Status


An example of the producer to send streams of data to topics in the Kafka cluster integrated for Bootique.

Also consider an example of Kafka-consumer.

For additional help/questions about this example send a message to Bootique forum.


  • Java 1.8 or newer.
  • Apache Maven.

Build the Demo

Here is how to build it:

git clone
cd bootique-kafka-producer
mvn package

Run the Demo

Now you can check the options available in your app:

java -jar target/bootique-kafka-producer-0.0.1-SNAPSHOT.jar --help

Option                                              Description
------                                              -----------    
-b host:port, --bootstrap-server=host:port          Single Kafka bootstrap server. Can be specified multiple times.
                                                    Optional. If omitted, will be read from YAML or environment variable

-c yaml_location, --config=yaml_location            Specifies YAML config location, which can be a file path or a URL.

-h, --help                                          Prints this message.

-H, --help-config                                   Prints information about application modules and their configuration

-p, --producer

-t topic_name, --topic=topic_name                   Kafka topic to write data to.

To test this example, you will need a Kafka broker release and a topic to write some string data into it. Run Zookeeper and Kafka broker both on localhost from Kafka root directory:

bin/ config/

bin/ config/

Run script to read string data from a topic:

bin/ --zookeeper localhost:2181 --topic topic 

Run the producer:

java -jar target/bootique-kafka-producer-0.0.1-SNAPSHOT.jar --bootstrap-server=localhost:9092 --topic=topic