Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gmo.MatchOptions = MQC.MQMO_NONE;
gmo.WaitInterval = waitInterval * 1000; // 3 seconds
if (msgId != null) {
console.log("Setting Match Option for MsgId");
gmo.MatchOptions = MQC.MQMO_MATCH_MSG_ID;
md.MsgId = hexToBytes(msgId);
}
// Set up the callback handler to be invoked when there
// are any incoming messages. As this is a sample, I'm going
// to tune down the poll interval from default 10 seconds to 0.5s.
// Also tune the polling to only get one message per attempt to
// to facilitate single shot async
mq.setTuningParameters({ getLoopPollTimeMs: 500, maxConsecutiveGets: 1 });
mq.Get(queueHandle, md, gmo, getCB);
}
setTimeout(() => {
// Resume processing second message
if (msgId2 != null) {
console.log("Setting Match Option for MsgId");
gmo.MatchOptions = MQC.MQMO_MATCH_MSG_ID;
md.MsgId = hexToBytes(msgId2);
}
mq.Get(hObj, md, gmo, getCB);
}, 2000 // Wait 2 seconds
)
gmo.WaitInterval = waitInterval * 1000; //
if (msgId != null) {
console.log("Setting Match Option for MsgId");
gmo.MatchOptions = MQC.MQMO_MATCH_MSG_ID;
md.MsgId = MQBoilerPlate.hexToBytes(msgId);
}
// Set up the callback handler to be invoked when there
// are any incoming messages. As this is a sample, I'm going
// to tune down the poll interval from default 10 seconds to 0.5s.
mq.setTuningParameters({
getLoopPollTimeMs: 500
});
mq.Get(queueObj, md, gmo, me.getCallback);
resolve();
});
}
MQC.MQGMO_CONVERT |
MQC.MQGMO_FAIL_IF_QUIESCING;
gmo.MatchOptions = MQC.MQMO_NONE;
gmo.WaitInterval = waitInterval * 1000; // 3 seconds
if (msgId != null) {
console.log("Setting Match Option for MsgId");
gmo.MatchOptions = MQC.MQMO_MATCH_MSG_ID;
md.MsgId = hexToBytes(msgId);
}
// Set up the callback handler to be invoked when there
// are any incoming messages. As this is a sample, I'm going
// to tune down the poll interval from default 10 seconds to 0.5s.
mq.setTuningParameters({getLoopPollTimeMs: 500});
mq.Get(queueHandle,md,gmo,getCB);
}
gmo.Options = MQC.MQGMO_NO_SYNCPOINT |
MQC.MQGMO_WAIT |
MQC.MQGMO_CONVERT |
MQC.MQGMO_FAIL_IF_QUIESCING;
// To start with, set the option to browse the FIRST message on the queue
gmo.Options |= MQC.MQGMO_BROWSE_FIRST;
gmo.MatchOptions = MQC.MQMO_NONE;
gmo.WaitInterval = waitInterval * 1000; // 3 seconds
// Set up the callback handler to be invoked when there
// are any incoming messages. As this is a sample, I'm going
// to tune down the poll interval from default 10 seconds to 0.5s.
mq.setTuningParameters({getLoopPollTimeMs: 500});
mq.Get(queueHandle,md,gmo,getCB);
}