node-kafka-zookeeper
A high-level client library in Node.js for the Apache Kafka project with Zookeeper integration
Kafka is a persistent, efficient, distributed publish/subscribe messaging system.
Prozess is a Kafka client library used for low-level access from node-kafka-zookeeper.
Consumer example:
A Kafkazoo
object handles broker enumeration and offset storage
var Kafkazoo = Kafkazoo;var kafka = host: 'localhost' port: 2181 zkPath: '/'; var { if error return log; // log some details log; log; // and get next batch ; // false will resend the same messages after a delay}; // Start consumingkafka; // Stop consuming
Utility examples:
The Kafkazoo
object also exposes some utility functions - used internally and useful for testing
var _ = ;var Kafkazoo = ; var kafka = host: 'localhost' port: 2181; var topic = 'KafkaTopic' group = 'ConsumerGroup'; // Retrieve all consumer offsets for topic/groupvar { if error return console; console;}; kafka; // Initialize consumer offsetsvar { if error return console; console;}; kafka;
Installation:
npm install kafka-zookeeper
Checkout the code and run the tests:
git clone https://github.com/devoncrouse/node-kafka-zookeeper.git
cd node-kafka-zookeeper; npm test
Kafka Compatability matrix:
Kakfa 0.8.0 Release | Not Supported |
Kafka 0.7.2 Release | Supported |
Kafka 0.7.1 Release | Supported |
Kafka 0.7.0 Release | Supported |
kafka-0.6 | Consumer-only support. |
kafka-0.05 | Not Supported |
Versions taken from http://incubator.apache.org/kafka/downloads.html