X Tutup
"# Kafka-MultiThread-Java-Example" ## 1. Import source code into Eclipse Menu **File –> Import –> Maven –> Existing Maven Projects** Browse to your source code location Click **Finish** button to finish the importing ## 2. Create the Kafka Topic Using commands in create-topics.sh (Linux) and create-topics.bat(Windows) ## 3. Run the example ### Model #1. Multiple consumers with their own threads Open the **MultipleConsumersMain.java** **Right click -> Run As -> Java Application** or use the shortcut: **Alt+Shift+x, j** to start the main method ### Model #2. Single consumer, multiple worker processing threads Open the **SingleConsumerMain.java** **Right click -> Run As -> Java Application** or use the shortcut: **Alt+Shift+x, j** to start the main method All the source code are described in: [Create Multi-threaded Apache Kafka Consumer](http://howtoprogram.xyz/2016/05/29/create-multi-threaded-apache-kafka-consumer/) ## 4. Related Posts ## [Getting started with Apache Kafka 0.9](http://howtoprogram.xyz/2016/04/30/getting-started-apache-kafka-0-9) ## [Apache Kafka 0.9 Java Client API Example] (http://howtoprogram.xyz/2016/05/02/apache-kafka-0-9-java-client-api-example)
X Tutup