Thanks for the support, Thanks Neil.
I tried too many combinations, eventually make it work.
Just decode the base64 request and send as buffer data, set MQMD header: CCSID 1140, encoding 785, format as 8 spaces.
Original Message:
Sent: Wed August 30, 2023 03:49 PM
From: mu cao
Subject: How to set the MQMD header to pass messageType = 'bytes' from DP to MQ?
Thanks a lot Neil, this is really helpful. I will try the two sceniros and let you know.
thanks,
------------------------------
mu cao
Original Message:
Sent: Wed August 30, 2023 03:13 AM
From: Neil Casey
Subject: How to set the MQMD header to pass messageType = 'bytes' from DP to MQ?
Hi Mu Cao,
The message format field has a number of standard values such as 'MQSTR ' (MQFMT_STRING) which are documented at https://www.ibm.com/docs/en/ibm-mq/9.3?topic=constants-mqfmt-formats.
But if your current system is sending a message using JMS, then the wire format of the MQ message will be different to a plain MQ message and will include JMS related headers such as an MQHRF2 header.
This will set the MQ message type to MQFMT_RF_HEADER_2 and the header will indicate the underlying message format.
For many applications, the distinction between a JMS message and an MQ native message may not matter, or might be handled by the configuration of the queue. However, some applications may rely on JMS related values provided in the header and might therefore not work without it, especially if the application was written to process the header manually.
Given your application is actually sending a CP1140 message, it might make sense to set that properly in the MQMD CCSID field, but that is up to you since your current application doesn't seem to be doing it.
You might also find that you do have to actually create a JMS message rather than a plain MQ message in order to get the receiving application to work. There are some pages around the web that might assist...
https://www.ibm.com/support/pages/using-websphere-datapower-set-jms-properties-mqrfh2-header
https://www.mqtechconference.com/sessions_v2016/MQTC2016-DPMQ-Slides.pdf
However, if your receiving application doesn't actually care about JMS and is able to receive a plain MQ message, then you should just need to decode the BASE64 into the equivalent binary (I think you need to do this, but maybe I'm wrong) to set the message payload and set the MQMD.Format field to 8 spaces (MQFMT_NONE).
Regards,
------------------------------
Neil Casey
Senior Consultant
Syntegrity Solutions
Melbourne, Victoria
IBM Champion (Cloud) 2019-22
Original Message:
Sent: Tue August 29, 2023 06:34 PM
From: mu cao
Subject: How to set the MQMD header to pass messageType = 'bytes' from DP to MQ?
Hi Linn,
Thanks for the response, the two links do not land to message type and format page.
Here is my scenario:
Existing working flow: copybook with CP 1140 message is base64 encoded sent to TIBCO adaptor, the adaptor set the JMS message type as bytes, and send the encoded message to MQ in mainframe, the downstream app will pick up message and do further process.
Now the TIBCO adaptor will be replaced by DP, DP will create a MQ manager and take the exact same message and send to mainframe MQ, I used the default MQ manager CCSID 819 and did not set any MQMD header, downstream app could not processing the message. should I change the MQ manager CCSID? to which ID? what MQMD header should I set?
thanks
------------------------------
mu cao
Original Message:
Sent: Mon August 28, 2023 05:18 PM
From: Steve Linn
Subject: How to set the MQMD header to pass messageType = 'bytes' from DP to MQ?
Hi Mu,
From the MQ Doc https://www.ibm.com/docs/en/ibm-mq/7.5?topic=constants-mqmt-message-types, MQMT_DATAGRAM has a value of 8, MQMT_REQUEST has a value of 1, etc, so in your example above, you have a Datagram (no reply expected). It's been quite a while since I did any MQ related work in DataPower, but as I recall I always used MQSTR for my formats. I did find this mq link that lists the other formats https://www.ibm.com/docs/en/ibm-mq/9.2?topic=constants-mqfmt-formats.
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Mon August 28, 2023 11:42 AM
From: mu cao
Subject: How to set the MQMD header to pass messageType = 'bytes' from DP to MQ?
Hi Joseph,
thanks for the reply, what MQ_NONE mean?
the IBM DP web site: https://www.ibm.com/docs/en/datapower-gateway/10.5.0?topic=module-urlopenopen-formats-mq-messages has example as:
var mqmd = { "MQMD": { "StructId": {"$":"MD"}, "Version": {"$":"1"}, "Report": {"$":"0"}, "MsgType": {"$":"8"}, "Expiry": {"$":"-1"}, "Feedback": {"$":"0"}, "Encoding": {"$":"546"}, "CodedCharSetId": {"$":"819"}, "Format": {"$":"MQSTR"}, "MsgId": {"$":"414d5120514d5f4a494d5f3130303530011cdf47020a0020"}, "CorrelId": {"$":"000000000000000000000000000000000000000000000000"}, "BackoutCount": {"$":"0"}, "ReplyToQ": {"$":""}, "ReplyToQMgr": {"$":"QM1"}, "UserIdentifier": {"$":"mqm"}, "AccountingToken": {"$":"0431303031000000000000000000000000000000000000000000000000000006"}, "ApplIdentityData": {"$":""}, "PutApplType": {"$":"6"}, "PutApplName": {"$":"putfile"}, "ApplOriginData": {"$":""} } }; var mqHeader = { "MQMD" : mqmd };
I tried to find the definition, but I could not, for example, MsgType and Format, what are the valid value? what is the meaning of the valid value? do you know where can find them?
thanks
------------------------------
mu cao
Original Message:
Sent: Thu August 24, 2023 12:59 PM
From: Joseph Morgan
Subject: How to set the MQMD header to pass messageType = 'bytes' from DP to MQ?
Not currently having a way to test it, isn't it something close to MQ_NONE or MQNONE?
------------------------------
Joseph Morgan
Original Message:
Sent: Wed August 23, 2023 03:05 PM
From: mu cao
Subject: How to set the MQMD header to pass messageType = 'bytes' from DP to MQ?
How could I set the MQMD header to pass messageType = 'bytes' from DP to MQ?
------------------------------
mu cao
------------------------------