node-kafka
Node.js binding for librdkafka. At this time, only the version of V8 included in node 0.10.x is supported.
Only connect and produce are implemented so far. consume will be forthcoming (but no immediate need)
KAFKA SETUP
Tested with kafka_2.8.0-0.8.0-beta1
From kafka folder
start servers
bin/zookeeper-server-start.sh config/zookeeper.propertiesbin/kafka-server-start.sh config/server.properties
create topic
bin/kafka-create-topic.sh --zookeeper localhost:2181 --replica 1 --partition 1 --topic test
check topic
bin/kafka-list-topic.sh --zookeeper localhost:2181
consumer
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test --from-beginning
test producer
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
BUILD
Configure
node-gyp configure
Initial build
node-gyp build
Rebuild
node-gyp rebuild
EXAMPLE
var kafka = ; var producer = brokers: "localhost:9092" partition: 0 topic: "test"; producer
TEST
node example.jsnode example2.js
LICENSE
See LICENSE, and LICENSE.* for dependencies