Last active
February 6, 2019 15:46
-
-
Save JannikZed/ffc2cff7de75da8441a12c153c5a62ea to your computer and use it in GitHub Desktop.
medium story NATS-streaming with node js
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 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); | |
}) |
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
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