0.0.6 • Published 8 years ago

kafka-consumer-router v0.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

Consume and route Kafka messages

Build Status

NPM

Install

add kafka-consumer-router to you package.json

Example

Check the example app for a working example on how to use the lib

Running kafka

There is a docker-compose configured to make tests easier

Usage

var kafkaConsumer = require('kafka-consumer-router');

var client = kafkaConsumer({
  // zkMaxSessionTimeout means the timeout zookeeper drops session and allow reconnects, when connecting before this period an exception will occur. Default is 30000ms.
  zkMaxSessionTimeout: 30000,
  connectionString: process.env.KAFKA_URL || '192.168.59.103:2181/'
});

client.route({
  topic: 'my-node-topic'
}, function(messages, callback) {
  console.log('my-node-topic messages: ' + messages.length);
  callback();
});

Options

TODO...

Test

$ npm install
$ node run test

TODO

  • Finish tests
  • Add Travis-CI
  • Publish to npm