Update msmq.js

This commit is contained in:
Namhyeon Go 2021-09-23 13:58:16 +09:00
parent c0f8159735
commit cfb2c65541

View File

@ -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();
};