How to use the ibmmq.Close function in ibmmq

To help you get started, we’ve selected a few ibmmq examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ibm-messaging / mq-mqi-nodejs / samples / amqssub.js View on Github external
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");
      }
    });
  });
}
github ibm-messaging / mq-dev-patterns / Node.js / basicsubscribe.js View on Github external
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");
      }
    });
  });
}
github ibm-messaging / mq-mqi-nodejs / tests / amqsgetar.js View on Github external
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");
      }
    });
  });
}
github ibm-messaging / mq-mqi-nodejs / samples / amqsgeta.js View on Github external
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");
      }
    });
  });
}
github ibm-messaging / mq-mqi-nodejs / samples / amqsput.js View on Github external
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");
      }
    });
  });
}
github ibm-messaging / mq-mqi-nodejs / samples / amqsget.js View on Github external
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");
      }
    });
  });
}
github ibm-messaging / mq-mqi-nodejs / samples / amqsbra.js View on Github external
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");
      }
    });
  });
}
github ibm-messaging / mq-dev-patterns / Node.js / basicrequest.js View on Github external
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");
github ibm-messaging / mq-dev-patterns / Node.js / boilerplate.js View on Github external
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);
      }
    }
  }
github ibm-messaging / mq-dev-patterns / Node.js / basicput.js View on Github external
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");
      }
    });
  });
}