-
-
Save mgeerling/86f76e2288147c5d31a92044331c21f8 to your computer and use it in GitHub Desktop.
This file contains 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 Kafka = require('no-kafka'); | |
var kafkaTopic = 'kafkaTest'; | |
var producer = new Kafka.Producer(); | |
var messageBuffer = ["msg1","msg2","msg3"]; | |
return producer.init().then(messageBuffer.forEach(function(index){ | |
return producer.send({ | |
topic: kafkaTopic, | |
partition: 0, | |
message: { | |
value: index | |
} | |
}); | |
})) | |
.then(function (result) { | |
//i just changed this line to be more positive of the outcome | |
console.log("mission complete"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment