Author |
Message
|
theone |
Posted: Thu Feb 01, 2007 5:51 am Post subject: create MQRFH2 problems |
|
|
Novice
Joined: 04 Dec 2006 Posts: 15
|
Hi,
I am using Message broker V6.
I am creating MQRFH2 in a Compute node. While debugging the MQRFH2 folder looks as expected, but once I am out of the Compute node MQRFH2 folder has empty MQRFH2.mcd.Fmt and MQRFH2.mcd.Set. In addition I set MQRFH2.mcd.Msd to jms_text but out of the compute node it is changing to xmlns.
Here is part of the code that creates the MQRFH2 folder:
Code: |
CREATE NEXTSIBLING OF OutputRoot.MQMD DOMAIN ('MQRFH2') NAME 'MQRFH2';
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = MQRFH_VERSION_2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = MQFMT_STRING;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Encoding = 546;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = 437;
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 1208;
SET OutputRoot.MQRFH2.mcd.Msd = 'jms_text'; |
Any idea why is it happening?
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 01, 2007 5:53 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Some or all of the MCD fields will be set by the MQOutput node based on Root.Properties. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
theone |
Posted: Thu Feb 01, 2007 5:58 am Post subject: |
|
|
Novice
Joined: 04 Dec 2006 Posts: 15
|
Thanks for your reply.
I get the extra mcd fields soon as I leave the compute node (before I get to any MQOutput node). |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 01, 2007 6:21 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Message content portions of the MCD are controlled by the Properties tree, and vice-versa.
Update the Properties tree. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
theone |
Posted: Thu Feb 01, 2007 7:06 am Post subject: |
|
|
Novice
Joined: 04 Dec 2006 Posts: 15
|
Nice one
Thanks a lot for your help. |
|
Back to top |
|
 |
Rockon |
Posted: Thu Feb 08, 2007 11:44 am Post subject: |
|
|
Apprentice
Joined: 24 May 2004 Posts: 43
|
adding up to this topic.....
I am trying to do the same effort, the part where u mention that the properties tree dictates the contents the MCD folder, i have the following code but the resulting message doesnt set the message domain to jms_text, instead it comes back as blank:
Code: |
CALL CopyMessageHeaders();
--CALL CopyEntireMessage();
SET OutputRoot.MQRFH2 = NULL;
--SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.Properties.MessageDomain = 'jms_text';
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
SET OutputRoot.MQRFH2.mcd.Msd = 'jms_text';
SET OutputRoot.MQRFH2.Version = MQRFH_VERSION_2;
SET OutputRoot.MQRFH2.Format = MQFMT_STRING;
SET OutputRoot.MQRFH2.jms.Dlv = '2';
SET OutputRoot.MQRFH2.jms.Tms = CURRENT_TIMESTAMP;
SET OutputRoot."BLOB"."UnknownParserName" = '';
SET OutputRoot."BLOB"."BLOB" = ASBITSTREAM(InputBody,FolderBitStream);
|
Objective is to send the incoming message out as a jms object in this case as a jms_text message.
With the above code the Msd is getting reset to blank.
Any inputs on where i am going wrong. |
|
Back to top |
|
 |
Rockon |
Posted: Thu Feb 08, 2007 2:17 pm Post subject: |
|
|
Apprentice
Joined: 24 May 2004 Posts: 43
|
Looking at the message at the debug mode, both the parameters(Properties and Msd) do get setup as 'jms_text'. But rt after the compute node both of these paramaters get reset to blank.I am wondering what feature within the compute node dictates the contents of this variable.
Any thoughts on this is appreciated.
Thankyou, |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Feb 08, 2007 3:35 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Well I bet you're having difficulties reading the JMS message as text.
So here's how you do it.
While creating the RFH you need to look at the message. If the message text is in ccsid a and encoding b you need to do following:
On the RFH2 set the ccsid to a for the text that follows it (msg body) and encoding to b. Set the message format to MQFMT_STRING
On the MQMD set the ccsid and encoding of the RFH. The format is set correctly.
Read up on how MQ treats headers. You might want to think of them as a linked list where each element contains information about the element coming immediately after it.
Enjoy
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
Rockon |
Posted: Thu Feb 08, 2007 5:36 pm Post subject: |
|
|
Apprentice
Joined: 24 May 2004 Posts: 43
|
yup you are right. I am having issues reading the message.I did change a couple of things like u suggested.but the same result.When u mention how MQ reads through the headers.
I read through the documentation:
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/csqzaw1481.htm
Code: |
SET OutputRoot.MQRFH2 = NULL;
--SET OutputRoot.MQMD = InputRoot.MQMD;
SET OutputRoot.Properties.MessageDomain = 'jms_text';
SET OutputRoot.MQMD.Encoding = InputRoot.Properties.Encoding;
SET OutputRoot.MQMD.CodedCharSetId = InputRoot.Properties.CodedCharSetId;
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = MQRFH_VERSION_2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Encoding = InputRoot.Properties.Encoding;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = InputRoot.Properties.CodedCharSetId;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = MQFMT_STRING;
SET OutputRoot.MQRFH2.mcd.Msd = 'jms_text';
SET OutputRoot.MQRFH2.jms.Dlv = '2';
SET OutputRoot.MQRFH2.jms.Tms = CURRENT_TIMESTAMP;
SET OutputRoot."BLOB"."UnknownParserName" = '';
SET OutputRoot."BLOB"."BLOB" = ASBITSTREAM(InputBody,FolderBitStream); |
M i missing something here.It also mentions in the documentation that :
Code: |
If a WebSphere MQ JMS application receives a message that does not have an MQRFH2 header, the TARGCLIENT property of the Queue or Topic object derived from the JMSReplyTo header field of the message, by default, is set to MQ. This means that a reply message sent to the queue or topic also does not have an MQRFH2 header. You can switch off this behavior of including an MQRFH2 header in a reply message only if the original message has an MQRFH2 header by setting the TARGCLIENTMATCHING property of the connection factory to NO.
|
But this refers to messages coming from the JMS client into a WMQ App.
So is there some setting that i have to take into consideration for messages going into a JMS Client as well via a MQ Queue at the Queue manager level. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Feb 09, 2007 4:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
JMS will read correctly the MQ message whether it has an RFH header or not.
On the other hand looking at your code ...
Leave OutputRoot.Properties.MessageDomain alone. In the mcd you will have something like xmlns, mrm or other which indicates which parser you used in wmb. Not a problem for jms.
In order to be read as a text message you need to have the RFH format be MQFMT_String. I see you are setting it. Better would be to pass the format of the inbound message. Thus setting the correct format (bytes or text).
No need to set the timestamp.
You might want to change the CCSID to the OutputRoot.Properties.CCSID for the value the text will have... instead of InputRoot.Properties.CCSID...
Set the ccsid of the name value pairs to 1208 on the RFH2.
Try again and let us know how you fared.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Rockon |
Posted: Fri Feb 09, 2007 8:51 am Post subject: |
|
|
Apprentice
Joined: 24 May 2004 Posts: 43
|
Thankyou all.That worked.
Dint have to do anything at the queue manager level.
Code: |
SET OutputRoot.MQRFH2 = NULL;
--SET OutputRoot.MQMD = InputRoot.MQMD;
--SET OutputRoot.Properties.MessageDomain = 'jms_text';
SET OutputRoot.MQMD.Encoding = OutputRoot.Properties.Encoding;
SET OutputRoot.MQMD.CodedCharSetId = OutputRoot.Properties.CodedCharSetId;
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = MQRFH_VERSION_2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Encoding = OutputRoot.Properties.Encoding;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = 1208;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = MQFMT_STRING;
--SET OutputRoot.MQRFH2.mcd.Msd = 'jms_text';
SET OutputRoot.MQRFH2.jms.Dlv = '2';
--SET OutputRoot.MQRFH2.jms.Tms = CURRENT_TIMESTAMP;
SET OutputRoot.MQRFH2.usr.GALOriginalDestination = 'GAL.MAIN.TEST';
SET OutputRoot."BLOB"."UnknownParserName" = '';
SET OutputRoot."BLOB"."BLOB" = ASBITSTREAM(InputBody,FolderBitStream); |
|
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Feb 10, 2007 7:35 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Rockon wrote: |
Thankyou all.That worked.
Dint have to do anything at the queue manager level.
Code: |
SET OutputRoot.MQRFH2 = NULL;
--SET OutputRoot.MQMD = InputRoot.MQMD;
--SET OutputRoot.Properties.MessageDomain = 'jms_text';
SET OutputRoot.MQMD.Encoding = OutputRoot.Properties.Encoding;
SET OutputRoot.MQMD.CodedCharSetId = OutputRoot.Properties.CodedCharSetId;
SET OutputRoot.MQMD.Format = MQFMT_RF_HEADER_2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = MQRFH_VERSION_2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Encoding = OutputRoot.Properties.Encoding;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = 1208;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = MQFMT_STRING;
--SET OutputRoot.MQRFH2.mcd.Msd = 'jms_text';
SET OutputRoot.MQRFH2.jms.Dlv = '2';
--SET OutputRoot.MQRFH2.jms.Tms = CURRENT_TIMESTAMP;
SET OutputRoot.MQRFH2.usr.GALOriginalDestination = 'GAL.MAIN.TEST';
SET OutputRoot."BLOB"."UnknownParserName" = '';
SET OutputRoot."BLOB"."BLOB" = ASBITSTREAM(InputBody,FolderBitStream); |
|
The 1208 you're setting here goes to the message body. You should still set OutputRoot.Properties.CodedCharSetId.
The 1208 is for the property- value pairs... i.e. for the JMS properties in the user folder. There are only a limited set of ccsids that are admissible for that folder and 1208 (UTF- is the easiest to use. Check for the other CCSID field on the RFH header.
Enjoy _________________ MQ & Broker admin |
|
Back to top |
|
 |
|