Running Apache Kafka 0.7
wget http://people.apache.org/~nehanarkhede/kafka-0.7.0-incubating/kafka-0.7.0-incubating-src.tar.gz
tar xvzf kafka-0.7.0-incubating-src.tar.gz
cd kafka-0.7.0-incubating-src
Bootstrap sbt
then enter sbt
command prompt:
./sbt
Download jars Kafka depends on, build Kafka, then exit sbt
prompt:
update
package
exit
Run ZooKeeper (in new terminal session)
bin/zookeeper-server-start.sh config/zookeeper.properties
Run Kafka server (in new terminal session)
bin/kafka-server-start.sh config/server.properties
Run test consumer (in new terminal session)
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
Run test producer (in new terminal session)
bin/kafka-console-producer.sh --zookeeper localhost:2181 --topic test
From test producer's terminal session, type a message then hit return to log a test
topic message:
Hello World!!!
Check test consumer's terminal session. You should see Hello World!!!
received by the consumer.
I haven't tested it yet but Marcus Westin has a Kafka client module for Node.js here which can be installed using NPM like this:
npm install kafka