Skip to content

MQRC_CONNECTION_BROKEN [2009] error #164

Open
@gowrimech32

Description

@gowrimech32

I am calling the below node js script from our application.

var mq = require('ibmmq');

 module.exports = {  
   /**
     Check if it is possible to connect to the system using the given connection
    */
     validate: function (input, options, output) {

       var MQC = mq.MQC;
       var qMgr = "XXXXXXX";
 
       var cno = new mq.MQCNO();
       var csp = new mq.MQCSP();
       csp.UserId = "XXXXXX";
       csp.Password = "********";
       cno.SecurityParms = csp;
 
       cno.Options |= MQC.MQCNO_CLIENT_BINDING;
 
       var cd = new mq.MQCD();
       cd.ConnectionName = "XXXXXXXXXX";
       cd.ChannelName = "XXXXXXXX";
       cno.ClientConn = cd;

       mq.Connx(qMgr, cno, function(err,conn) {
         if (err) {
           logger.error(err);
           logger.error('MQ connection validation failed.')
           return output(err, {
             'result' : 'MQ connection validation failed.'
           })
         } else {
           logger.info('MQ connection validation successfully.')
             mq.Disc(conn, function(err) {
               if (err) {
                 logger.error("MQDISC failed");
               } else {
                 logger.info("MQDISC successful");
               }
             });
           return output(null, {
             'result': 'Connection validated successfully'
           })
         }
       });
     }
 }

The application user has access to Queue manager. If i run this method as a standalone script, it works fine. but if i run from application, then getting below error message.

CONNX: MQCC = MQCC_FAILED [2] MQRC = MQRC_CONNECTION_BROKEN [2009];MQCC_FAILED:2009;MQRC_CONNECTION_BROKEN

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions