Author |
Message
|
MiLi |
Posted: Thu Feb 02, 2006 1:49 am Post subject: ccsid in MQMD or MQRFH2, what controls what? |
|
|
Acolyte
Joined: 07 Oct 2005 Posts: 51
|
Hi
I cant find the answer to my farily simple question.
is the MQMD.CodedCharSetId allways refering to the "real" message, or is it just refering to the next "element" that could be a MQRFH2 header?
So if there is a MQRFH2 header, is it the MQRFH2.CodedCharSetId thats telling me what ccsid the message data is in?
The Help is telling me
Quote: |
The MQMD properties of CodedCharSetId and Encoding define the code page and encoding of the section of the message that follows (typically this is either the MQRFH2 header or the message body itself).
|
Can someone help? _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Instructor - WebSphere MQ, WebSphere Message Broker |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Feb 02, 2006 1:54 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi MiLi,
Your understanding and what the document says is the same, and it is correct.
Regards. |
|
Back to top |
|
 |
MiLi |
Posted: Thu Feb 02, 2006 2:02 am Post subject: |
|
|
Acolyte
Joined: 07 Oct 2005 Posts: 51
|
ok thanks, but this is if you let me say so, stupid!
I cant in my message flow trust that the MQMD properties is the properties of my data couse if there is a second header, it could replace the Format, CCSID and Encoding to something else.
Is there any thought how to handle this? _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Instructor - WebSphere MQ, WebSphere Message Broker |
|
Back to top |
|
 |
elvis_gn |
Posted: Thu Feb 02, 2006 3:15 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi MiLi,
Why will you have an MQRFH2 header which will not identify the correct format of the InputBody.....
Anyway was going through the input node properties.
I think only the format in the MQRFH2 will take precedence over what u have specified in the node, but the encoding and CCSID are taken from the MQMD itself, or can be specified by u in the node.
Regards. |
|
Back to top |
|
 |
MiLi |
Posted: Thu Feb 02, 2006 4:27 am Post subject: |
|
|
Acolyte
Joined: 07 Oct 2005 Posts: 51
|
The MQRFH2 header will always identify the correct format of the inputbody, my problem is a dont know if there is any rfh2 on the incoming message.
Well my scenario is that I'm defining a general logging solution that will log the incoming message to a database:
Code: |
IF CARDINALITY(ROOT_REF.MQRFH2[]) <> 0 THEN
SET ENVIRONMENT_REF.DB.MSG_EVENT[newEntry].MSG_DATA = cast(BITSTREAM(BODY_REF) as char ccsid ROOT_REF.MQRFH2.CodedCharSetId);
ELSE
SET ENVIRONMENT_REF.DB.MSG_EVENT[newEntry].MSG_DATA = cast(BITSTREAM(BODY_REF) as char ccsid ROOT_REF.MQMD.CodedCharSetId);
END IF;
|
If remote system is sending data with a rfh2 header it could be different ccsid in mqm and rfh2, right?
But as you said, I could use the Properties.CodedCharSetId to be sure to the right ccsid.
I create an outgoing xml looking like:
<MsgEvent xmlns="http://xml/log"> <MsgId>414d51204649434f4e504f432020202070a6d44320001a37</MsgId>
<MsgData>SE01020304056666666666KJ 00000555555555500000300000020051220 </MsgData>
<SystemId>BOX</SystemId>
<ModuleId>na</ModuleId>
<EventType>RP</EventType>
<EventText>New Message</EventText>
<Status>1</Status>
<CreatedTime>2006-02-02 13:14:19.508</CreatedTime>
<SourceQueue>LOQ.DEBUG.IN</SourceQueue>
<MsgSequence>1</MsgSequence>
</MsgEvent>
the message data here is coded in the same ccsid as the MQMessage I put. Then a Java app is getting the message and writing the data to a database. _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Instructor - WebSphere MQ, WebSphere Message Broker |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 02, 2006 4:55 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Does InputRoot.Properties.CodedCharSetId match the CCSID on the RFH2 or on the MQMD? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
MiLi |
Posted: Thu Feb 02, 2006 5:40 am Post subject: |
|
|
Acolyte
Joined: 07 Oct 2005 Posts: 51
|
It matches the MQRFH2 if there is any, otherwise MQMD. _________________ IBM Certified System Administrator - WebSphere MQ V6.0
IBM Instructor - WebSphere MQ, WebSphere Message Broker |
|
Back to top |
|
 |
mvic |
Posted: Thu Feb 02, 2006 6:02 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
MiLi wrote: |
I cant in my message flow trust that the MQMD properties is the properties of my data couse if there is a second header, it could replace the Format, CCSID and Encoding to something else.
Is there any thought how to handle this? |
MQ's JMS classes (included with an MQ client or server) and XMS code (available for download) handles all of this for you.
If you need to do your own parsing, the rules are documented in http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzaw.doc/csqzaw1381.htm |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 02, 2006 6:43 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
MiLi wrote: |
It matches the MQRFH2 if there is any, otherwise MQMD. |
This was kind of my point. InputRoot.Properties.CodedCharSetId should contain the value of the CCSID that applies to the message body, always.
InputRoot.MQMD.CodedCharSetId, as has been shown, will only always contain the CCSID of the next section of the message. This makes some sense, because you need this information before you can start to process the next section.
So rather than coding logic to find out what the last CCSID is, you can just use InputRoot.Properties.CodedCharSetID always. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|