Skip to content

Commit

Permalink
merged readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
bkimminich committed Jul 8, 2014
1 parent a45dfbd commit 71ecb05
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Fixed and updated sample implementations from the book "Apache Kafka"
=====================================================================
Fixed and updated code examples from the book "Apache Kafka"
============================================================
* Updated to Apache Kafka 0.8.1.1
* Configuration optimized for usage on Windows machines
* Windows batch scripts fixed (taken from https://github.com/HCanber/kafka by @HCanber)
Expand Down Expand Up @@ -30,25 +30,25 @@ Java Producer with Message Partitioning (Chapter 5, Page 37ff.)
3. Open a second command line in your Kafka installation folder
4. Launch first Kafka broker: `.\bin\windows\kafka-server-start.bat .\config\server-1.properties`
5. Open a third command line in your Kafka installation folder
4. Launch second Kafka broker: `.\bin\windows\kafka-server-start.bat .\config\server-2.properties`
5. Open a fourth command line in your Kafka installation folder
6. Create a topic: `.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 2 --partitions 4 --topic test`
7. Start a console consumer for that topic: `.\bin\windows\kafka-console-consumer.bat --zookeeper localhost:2181 --topic test --from-beginning`
8. From a fifth command line or your IDE run [MultiBrokerProducer](/src/test/kafka/MultiBrokerProducer.java) with topic as argument: `java MultiBrokerProducer test`
9. Ten messages starting with _This message is for key (...)_ should appear in the console consumer's log
6. Launch second Kafka broker: `.\bin\windows\kafka-server-start.bat .\config\server-2.properties`
7. Open a fourth command line in your Kafka installation folder
8. Create a topic: `.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 2 --partitions 4 --topic test`
9. Start a console consumer for that topic: `.\bin\windows\kafka-console-consumer.bat --zookeeper localhost:2181 --topic test --from-beginning`
10. From a fifth command line or your IDE run [MultiBrokerProducer](/src/test/kafka/MultiBrokerProducer.java) with topic as argument: `java MultiBrokerProducer test`
11. Ten messages starting with _This message is for key (...)_ should appear in the console consumer's log

Simple High Level Java Consumer (Chapter 6, Page 47ff.)
-------------------------------------------------------
1. Launch multi-broker Kafka cluster and create topic `test` as described in step 1-6 of __Java Producer with Message Partitioning__
1. Launch multi-broker Kafka cluster and create topic `test` as described in step 1-8 of __Java Producer with Message Partitioning__
2. From another command line or your IDE run [SimpleHLConsumer](/src/test/kafka/consumer/SimpleHLConsumer.java) with topic as argument: `java SimpleHLConsumer test`
3. From another command line or your IDE run [MultiBrokerProducer](/src/test/kafka/MultiBrokerProducer.java) with same topic as argument: `java MultiBrokerProducer test`
4. Ten messages starting with _This message is for key (...)_ should appear in the log of the __SimpleHLConsumer__

Multithreaded Consumer for Multipartition Topics (Chapter 6, Page 50ff.)
------------------------------------------------------------------------
1. Launch multi-broker Kafka cluster and create topic `test` as described in step 1-6 of __Java Producer with Message Partitioning__
1. Launch multi-broker Kafka cluster and create topic `test` as described in step 1-8 of __Java Producer with Message Partitioning__
2. From another command line or your IDE run [MultiThreadHLConsumer](/src/test/kafka/consumer/MultiThreadHLConsumer.java) with topic and number of threads as argument: `java MultiThreadHLConsumer test 4`
3. From another command line or your IDE run [MultiBrokerProducer](/src/test/kafka/MultiBrokerProducer.java) with same topic as argument: `java MultiBrokerProducer test`
4. Ten messages starting with _Message from thread (...)_ should appear in the log of the __MultiThreadHLConsumer__
3. From another command line or your IDE run [MultiBrokerProducer](/src/test/kafka/MultiBrokerProducer.java) with same topic as argument: `java MultiBrokerProducer test` (Note: You must start producing messages within 10sec after starting the consumer class, otherwise the consumer will shut down)
4. Ten messages starting with _Message from thread (...)_ should appear in the log of the __MultiThreadHLConsumer__ spread among the four threads

[![endorse](https://api.coderwall.com/bkimminich/endorsecount.png)](https://coderwall.com/bkimminich)
1 change: 0 additions & 1 deletion bat/README.md

This file was deleted.

0 comments on commit 71ecb05

Please sign in to comment.