A MSMQ implementation for node.js
$ npm install --save node-msmq
Sends a message to a MSMQ queue.
const msmq = require('node-msmq');
var queue = msmq.openOrCreateQueue('.\\Private$\\MyAwesomeQueue');
// Send message to queue
queue.send('Hello from Node.JS!');
Start receiving messages from a queue.
const msmq = require('node-msmq');
var queue = msmq.openOrCreateQueue('.\\Private$\\MyAwesomeQueue');
// Set receive listener callback
queue.on('receive', (msg) => {
console.log(msg.body);
});
// Start receiving messages from the queue
queue.startReceiving();
Gets all messages without removing them from queue.
const msmq = require('node-msmq');
var queue = msmq.openOrCreateQueue('.\\Private$\\MyAwesomeQueue');
var messages = queue.getAllMessages();
Clears all messages from the queue.
const msmq = require('node-msmq');
var queue = msmq.openOrCreateQueue('.\\Private$\\MyAwesomeQueue');
queue.purge();
MIT © Marco Barcelos