Skip to content

Instantly share code, notes, and snippets.

@JannikZed
Last active February 6, 2019 15:46
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 JannikZed/ffc2cff7de75da8441a12c153c5a62ea to your computer and use it in GitHub Desktop.
Save JannikZed/ffc2cff7de75da8441a12c153c5a62ea to your computer and use it in GitHub Desktop.
medium story NATS-streaming with node js
var nats = require('node-nats-streaming').connect('fissionMQTrigger', 'web-crawler-'+Math.random().toString(11).replace('0.', ''), process.env.NATS_CONNECTION)
nats.on('error', function(err) {
console.log(err);
})
nats.publish('profile.enrichment.input', JSON.stringify({
network: 'lin',
service: 'lin-scrapper',
id: profileId,
content: doc.profile
}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment