Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function cleanup(hConn,hObjPubQ, hObjSubscription) {
// Demonstrate two ways of closing queues - first using an exception, then
// the version with callback.
try {
mq.CloseSync(hObjSubscription,0);
console.log("MQCLOSE (Subscription) successful");
} catch (err) {
console.log("MQCLOSE (Subscription) ended with reason " + err);
}
mq.Close(hObjPubQ, 0, function(err) {
if (err) {
console.log("MQCLOSE (PubQ) ended with reason " + err.mqrc);
} else {
console.log("MQCLOSE (PubQ) successful");
}
mq.Disc(hConn, function(err) {
if (err) {
console.log("MQDISC ended with reason " + err.mqrc);
} else {
console.log("MQDISC successful");
}
});
});
}
function cleanup(hConn, hObjPubQ, hObjSubscription) {
// Demonstrate two ways of closing queues - first using an exception, then
// the version with callback.
try {
mq.Close(hObjSubscription, 0);
debug_info("MQCLOSE (Subscription) successful");
} catch (err) {
debug_warn("MQCLOSE (Subscription) ended with reason " + err.mqrc);
}
mq.Close(hObjPubQ, 0, function(err) {
if (err) {
debug_warn("MQCLOSE (PubQ) ended with reason " + err.mqrc);
} else {
debug_info("MQCLOSE (PubQ) successful");
}
mq.Disc(hConn, function(err) {
if (err) {
debug_warn("MQDISC ended with reason " + err.mqrc);
} else {
debug_info("MQDISC successful");
}
});
});
}
function cleanup(hConn, hObj) {
mq.Close(hObj, 0, function (err) {
if (err) {
console.log(formatErr(err));
} else {
console.log("MQCLOSE successful");
}
mq.Disc(hConn, function (err) {
if (err) {
console.log(formatErr(err));
} else {
console.log("MQDISC successful");
}
});
});
}
function cleanup(hConn,hObj) {
mq.Close(hObj, 0, function(err) {
if (err) {
console.log(formatErr(err));
} else {
console.log("MQCLOSE successful");
}
mq.Disc(hConn, function(err) {
if (err) {
console.log(formatErr(err));
} else {
console.log("MQDISC successful");
}
});
});
}
function cleanup(hConn,hObj) {
mq.Close(hObj, 0, function(err) {
if (err) {
console.log(formatErr(err));
} else {
console.log("MQCLOSE successful");
}
mq.Disc(hConn, function(err) {
if (err) {
console.log(formatErr(err));
} else {
console.log("MQDISC successful");
}
});
});
}
function cleanup(hConn,hObj) {
mq.Close(hObj, 0, function(err) {
if (err) {
console.log(formatErr(err));
} else {
console.log("MQCLOSE successful");
}
mq.Disc(hConn, function(err) {
if (err) {
console.log(formatErr(err));
} else {
console.log("MQDISC successful");
}
});
});
}
function cleanup(hConn,hObj) {
mq.Close(hObj, 0, function(err) {
if (err) {
console.log(formatErr(err));
} else {
console.log("MQCLOSE successful");
}
mq.Disc(hConn, function(err) {
if (err) {
console.log(formatErr(err));
} else {
console.log("MQDISC successful");
}
});
});
}
function cleanup(hConn, hObj, hObjDynamic) {
mq.Close(hObjDynamic, 0, function(err) {
if (err) {
debug_warn('Error Detected in Close operation of Dynamic queue', err);
} else {
debug_info("MQCLOSE successful of dynamic queue");
}
mq.Close(hObj, 0, function(err) {
if (err) {
debug_warn('Error Detected in Close operation', err);
} else {
debug_info("MQCLOSE successful");
}
mq.Disc(hConn, function(err) {
if (err) {
debug_warn('Error Detected in Disconnect operation', err);
} else {
debug_info("MQDISC successful");
static closeSubscription(hObjSubscription) {
if (hObjSubscription) {
try {
mq.Close(hObjSubscription, 0);
debug_info("MQCLOSE (Subscription) successful");
} catch (err) {
debug_warn("MQCLOSE (Subscription) ended with reason " + err.mqrc);
}
}
}
function cleanup(hConn, hObj) {
mq.Close(hObj, 0, function(err) {
if (err) {
debug_warn('Error Detected in Close operation', err);
} else {
debug_info("MQCLOSE successful");
}
mq.Disc(hConn, function(err) {
if (err) {
debug_warn('Error Detected in Disconnect operation', err);
} else {
debug_info("MQDISC successful");
}
});
});
}