ibm-messaging / mq-mqi-nodejs

Calling IBM MQ from Node.js - a JavaScript MQI wrapper
Apache License 2.0
79 stars 41 forks source link

Put message not writing same message to MQ side , it writing ......&)) #177

Open jptech8 opened 9 months ago

jptech8 commented 9 months ago

Below peice of code not same string to MQside instead its writing some gibberish headers character at MQ side , it set MQMDas well

function putMessage(hObj) {

55

56 var msg = 'MSH|^~\&|SENDING_APP|SENDING_FACILITY|RECEIVING_APP|RECEIVING_FACILITY|20220229120000||ADT^A08|123456789|P|2.3||||'

57

58 var mqmd = new mq.MQMD(); // Defaults are fine.

59 var pmo = new mq.MQPMO();

60var mqmd = new mq.MQMD();

mqmd.Format = 'MQSTR'

62 pmo.Options = MQC.MQPMO_NO_SYNCPOINT |

63 MQC.MQPMO_NEW_MSG_ID |

64 MQC.MQPMO_NEW_CORREL_ID;

65

66 mq.Put(hObj,mqmd,pmo,msg,function(err) {

67 if (err) {

68 console.log(formatErr(err));

69 } else {

70 console.log("MsgId: " + toHexString(mqmd.MsgId));

71 console.log("MQPUT successful");

72 }

73 });

74}

jptech8 commented 8 months ago

any idea to set 37 EBCDIC character set

chughts commented 8 months ago

Please format your code so it is readable. You don't need to include line numbers.