Instructions below based on:
- http://stackoverflow.com/questions/14735363
- http://kafka.apache.org/quickstart.html
- https://cwiki.apache.org/KAFKA/kafka-08-quick-start.html
$ git clone [email protected]:miguno/kafka.git
$ cd kafka
# this branch of mine includes a patched bin/kafka-run-class.sh
$ git checkout -b scala-2.9.2 remotes/origin/scala-2.9.2
$ ./sbt update
$ ./sbt "++2.9.2 package"
# ZooKeeper
$ bin/zookeeper-server-start.sh config/zookeeper.properties
# Kafka broker
$ bin/kafka-server-start.sh config/server.properties
$ bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic zerg.hydra --partitions 1 --replication-factor 1
$ bin/kafka-topics.sh --zookeeper localhost:2181 --list
<snipp>
zerg.hydra
</snipp>
Start a console producer:
$ bin/kafka-console-producer.sh --broker-list localhost:9092 --sync --topic zerg.hydra
You can now enter new messages, one per line.
Start a console consumer:
$ bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic zerg.hydra --from-beginning
The consumer will see a new message whenever you enter a message in the producer above.
- Kafka persists its topics in the log directory
/tmp/kafka-logs
(default location; seeconfig/server.properties
)