You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/02/12 08:25:52 UTC
[3/3] camel git commit: Polished. This closes #1457
Polished. This closes #1457
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bad73bee
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bad73bee
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bad73bee
Branch: refs/heads/master
Commit: bad73bee9c7b73ac5f1828b2bc3b4ef84b1cfe0c
Parents: 58a00ec
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Feb 12 09:25:41 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Feb 12 09:25:41 2017 +0100
----------------------------------------------------------------------
examples/README.md | 1 +
examples/camel-example-kafka/README.md | 32 +++++++++++++++++++----------
2 files changed, 22 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/bad73bee/examples/README.md
----------------------------------------------------------------------
diff --git a/examples/README.md b/examples/README.md
index 609d881..95b9b83 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -78,6 +78,7 @@ All examples have been sort by type/category
* [camel-example-activemq-tomcat](camel-example-activemq-tomcat/README.md)
* [camel-example-jms-file](camel-example-jms-file/README.md)
+* [camel-example-kafka](camel-example-kafka/README.md)
* [camel-example-guice-jms](camel-example-guice-jms/README.md)
* [camel-example-pojo-messaging](camel-example-pojo-messaging/README.md)
http://git-wip-us.apache.org/repos/asf/camel/blob/bad73bee/examples/camel-example-kafka/README.md
----------------------------------------------------------------------
diff --git a/examples/camel-example-kafka/README.md b/examples/camel-example-kafka/README.md
index 39a5fee..06c7374 100644
--- a/examples/camel-example-kafka/README.md
+++ b/examples/camel-example-kafka/README.md
@@ -4,38 +4,48 @@
An example which shows how to integrate Camel with Kakfa.
-This example requires that Kafka Server is up and running.
+This project consists of the following examples:
-You will need to create following topics before you run the examples.
+ 1. Send messages continuously by typing on the command line.
+ 2. Example of partitioner for a given producer.
+ 3. Topic is sent in the header as well as in the URL.
-bin\windows\kafka-topics.bat --create --zookeeper <zookeeper host ip>:<port> --replication-factor 1 --partitions 2 --topic TestLog
-bin\windows\kafka-topics.bat --create --zookeeper <zookeeper host ip>:<port> --replication-factor 1 --partitions 1 --topic AccessLog
-This project consists of the following examples:
+### Preparing Kafka
+
+This example requires that Kafka Server is up and running.
+
+You will need to create following topics before you run the examples.
+On windows run
- 1. Send messages continuously by typing on the command line.
- 2. Example of partitioner for a given producer.
- 3. Topic is sent in the header as well as in the URL.
+ kafka-topics.bat --create --zookeeper <zookeeper host ip>:<port> --replication-factor 1 --partitions 2 --topic TestLog
+
+ kafka-topics.bat --create --zookeeper <zookeeper host ip>:<port> --replication-factor 1 --partitions 1 --topic AccessLog
+On linux run
+
+ kafka-topics.sh --create --zookeeper <zookeeper host ip>:<port> --replication-factor 1 --partitions 2 --topic TestLog
+
+ kafka-topics.sh --create --zookeeper <zookeeper host ip>:<port> --replication-factor 1 --partitions 1 --topic AccessLog
### Build
You will need to compile this example first:
- mvn compile
+ mvn compile
### Run
1. Run the consumer first in separate shell
- mvn compile exec:java -Pkafka-consumer
+ mvn compile exec:java -Pkafka-consumer
2. Run the message producer in the seperate shell
- mvn compile exec:java -Pkafka-producer
+ mvn compile exec:java -Pkafka-producer
Initially, some messages are sent programmatically.