finn-workshop-helpers
v0.0.9
Published
finn-workshop-helpers
Downloads
5
Keywords
Readme
Usage of queue
Consuming messages:
const { queue, config } = require('finn-workshop-helpers');
const q = queue(config.amqpUri, 'queue-name')
q.on('connected', (q) => {
console.log('Connected');
})
.on('message', (msg) => console.log('Message:', msg))
.on('error', (err) => console.error('Error:', err));
Send messages:
q.sendMessage('name', 'msg')
.then(() => console.log('Message sent'))
.catch(console.error);