How to run sample application

Abhishek Sharma edited this page Apr 2, 2014 · 16 revisions

Kafka-Message-Server is an sample application for demonstrating kafka usage as message-server. Please follow the below instructions for productive use of the sample application.

1) Download Apache kafka version 0.8.0 zip file from kafka download page and extract it.

2) There is no need to set hadoop or zookeper in your system. You can use zookeper startup script present in bin folder of Kafka.

3) For the execution of the sample application - copy 'kafka-message-server-example-0.8.0.jar' in to the kafka folder where 'kafka_2.8.0-0.8.0.jar' is present. Sample application is dependent on 'commons-cli-1.1.jar'. Copy 'commons-cli-1.1.jar' in to the 'libs' folder of the Apache Kafka.

4) Copy following scripts from 'Kafka-Message-Server-Example/config' folder in to 'bin' folder of kafka

  • a)
  • b)
  • c)
  • d)

give execution permission to the scripts using chmod command.

5) Copy 'commons-cli-1.1.jar' in to the Kafka 'libs' folder.

6) Start Zookeper server using command - bin/ config/

7) Start Kafka server using command - bin/ config/

8) Start mail content creation program using command - bin/ -path [directory-path]

Output will look like -content creation program

9) Start message server mail producer using command - bin/ -path [same directory path given above] -topic [topic name]

Output will look like - producer output

10) Start message server mail consumer using command - bin/ -topic [same topic name given above]

Output will look like - consumer output