mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Update msmq.js
This commit is contained in:
parent
c0f8159735
commit
cfb2c65541
11
lib/msmq.js
11
lib/msmq.js
|
@ -28,10 +28,12 @@ var MSMQObject = function(queueName) {
|
|||
} catch (e) {
|
||||
console.error("MSMQObject.create() ->", e.message);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
this.open = function() {
|
||||
this.queue = this.queueInfo.Open(MQ_SEND_ACCESS, MQ_DENY_NONE);
|
||||
return this;
|
||||
}
|
||||
|
||||
// For example: .send("Sample Body", "LabelXX");
|
||||
|
@ -40,12 +42,17 @@ var MSMQObject = function(queueName) {
|
|||
mqmsg.Body = body
|
||||
mqmsg.Label = label
|
||||
mqmsg.Send(this.queue);
|
||||
mqmsg = null;
|
||||
return mqmsg;
|
||||
};
|
||||
|
||||
|
||||
this.recv = function() {
|
||||
return this.queue.Receive(MQ_NO_TRANSACTION, false, true, 20000, false);
|
||||
};
|
||||
|
||||
this.create();
|
||||
};
|
||||
|
||||
exports.MSMQObject = MSMQObject;
|
||||
exports.open = function(queueName) {
|
||||
return (new MSMQObject(queueName)).open();
|
||||
};
|
Loading…
Reference in New Issue
Block a user