Last active
September 14, 2015 20:25
-
-
Save jp/0b42b6267c520dd22e9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var kafkaHost="kafka.example.com:2181" | |
var kafka = require('kafka-node'), | |
Producer = kafka.Producer, | |
Consumer = kafka.Consumer, | |
client = new kafka.Client(kafkaHost, "default_topic"), | |
consumer = new Consumer( | |
client, | |
[ | |
{ topic: process.argv[2], partition: 0 } | |
], | |
{ | |
autoCommit: false | |
} | |
); | |
consumer.on('message', function (message) { | |
console.log(message) | |
//value = JSON.parse(message['value']) | |
//console.log(value['body']); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment