https://github.com/marcobarcelos/node-msmq
A MSMQ implementation for node.js
https://github.com/marcobarcelos/node-msmq
javascript message-queue msmq msmqueue node-msmq nodejs queue windows
Last synced: 11 months ago
JSON representation
A MSMQ implementation for node.js
- Host: GitHub
- URL: https://github.com/marcobarcelos/node-msmq
- Owner: marcobarcelos
- License: mit
- Created: 2016-05-16T00:08:59.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-08-02T17:23:17.000Z (almost 8 years ago)
- Last Synced: 2025-07-12T05:23:48.740Z (12 months ago)
- Topics: javascript, message-queue, msmq, msmqueue, node-msmq, nodejs, queue, windows
- Language: C#
- Size: 6.84 KB
- Stars: 8
- Watchers: 3
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# node-msmq
> A MSMQ implementation for node.js
## Install
```
$ npm install --save node-msmq
```
## Usage
### Send a message
Sends a message to a MSMQ queue.
```js
const msmq = require('node-msmq');
var queue = msmq.openOrCreateQueue('.\\Private$\\MyAwesomeQueue');
// Send message to queue
queue.send('Hello from Node.JS!');
```
### Receive messages
Start receiving messages from a queue.
```js
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();
```
### Get all messages
Gets all messages without removing them from queue.
```js
const msmq = require('node-msmq');
var queue = msmq.openOrCreateQueue('.\\Private$\\MyAwesomeQueue');
var messages = queue.getAllMessages();
```
### Purge a queue
Clears all messages from the queue.
```js
const msmq = require('node-msmq');
var queue = msmq.openOrCreateQueue('.\\Private$\\MyAwesomeQueue');
queue.purge();
```
## License
MIT © [Marco Barcelos](http://marcobarcelos.com)