From 71ecb05e016d0a1bdb6542a80979154860ef5914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kimminich?= Date: Tue, 8 Jul 2014 13:00:40 +0200 Subject: [PATCH] merged readme files --- README.md | 24 ++++++++++++------------ bat/README.md | 1 - 2 files changed, 12 insertions(+), 13 deletions(-) delete mode 100644 bat/README.md diff --git a/README.md b/README.md index 699da11..39a2068 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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) \ No newline at end of file diff --git a/bat/README.md b/bat/README.md deleted file mode 100644 index 253c3a9..0000000 --- a/bat/README.md +++ /dev/null @@ -1 +0,0 @@ -Fixed Windows batch scripts for Kafka 0.8.1 from https://github.com/HCanber/kafka \ No newline at end of file