Skip to content

Instantly share code, notes, and snippets.

@benstopford
Created November 9, 2017 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benstopford/2560dafc52e87da40e657e9c0d60bf08 to your computer and use it in GitHub Desktop.
Save benstopford/2560dafc52e87da40e657e9c0d60bf08 to your computer and use it in GitHub Desktop.
//In Node.js service
var nodemailer = require('nodemailer');
var kafka = require('kafka-node'),
Consumer = kafka.Consumer,
client = new kafka.Client(),
consumer = new Consumer(client, [ { topic: 'platinum_emails', partition: 0 } ] );
consumer.on('message', function (orderConsumerTuple) {
sendMail(orderConsumerTuple);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment