kafka-consumer-router

0.0.6 • Public • Published

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

Package Sidebar

Install

npm i kafka-consumer-router

Weekly Downloads

9

Version

0.0.6

License

MIT

Last publish

Collaborators

  • felipesabino
  • taqtile
  • lucasbcoelho