kafka-consumer-router
v0.0.6
Published
Consume and route Kafka messages
Downloads
4
Readme
Consume and route Kafka messages
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
- [x] Add Travis-CI
- [x] Publish to npm