How to use the ibmmq.MQRFH2 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 / amqsget.js View on Github external
mq.GetSync(hObj,mqmd,gmo,buf,function(err,len) {
    if (err) {
       if (err.mqrc == MQC.MQRC_NO_MSG_AVAILABLE) {
         console.log("no more messages");
       } else {
         console.log(formatErr(err));
       }
       ok = false;
    } else {
      var format = mqmd.Format;
      switch (format) {
      case MQC.MQFMT_RF_HEADER_2:
        hdr   = mq.MQRFH2.getHeader(buf);
        var props = mq.MQRFH2.getProperties(hdr,buf);
        console.log("RFH2 HDR is %j",hdr);
        console.log("Properties are '%s'",props);
        printBody(hdr.Format,buf.slice(hdr.StrucLength),len-hdr.StrucLength);
        break;
      case MQC.MQFMT_DEAD_LETTER_HEADER:
        hdr = mq.MQDLH.getHeader(buf);
        console.log("DLH HDR is %j",hdr);
        printBody(hdr.Format,buf.slice(hdr.StrucLength),len-hdr.StrucLength);
        break;
      default:
        printBody(format,buf,len);
        break;
      }
    }
  });
}
github ibm-messaging / mq-mqi-nodejs / samples / amqsget.js View on Github external
mq.GetSync(hObj,mqmd,gmo,buf,function(err,len) {
    if (err) {
       if (err.mqrc == MQC.MQRC_NO_MSG_AVAILABLE) {
         console.log("no more messages");
       } else {
         console.log(formatErr(err));
       }
       ok = false;
    } else {
      var format = mqmd.Format;
      switch (format) {
      case MQC.MQFMT_RF_HEADER_2:
        hdr   = mq.MQRFH2.getHeader(buf);
        var props = mq.MQRFH2.getProperties(hdr,buf);
        console.log("RFH2 HDR is %j",hdr);
        console.log("Properties are '%s'",props);
        printBody(hdr.Format,buf.slice(hdr.StrucLength),len-hdr.StrucLength);
        break;
      case MQC.MQFMT_DEAD_LETTER_HEADER:
        hdr = mq.MQDLH.getHeader(buf);
        console.log("DLH HDR is %j",hdr);
        printBody(hdr.Format,buf.slice(hdr.StrucLength),len-hdr.StrucLength);
        break;
      default:
        printBody(format,buf,len);
        break;
      }
    }
  });