ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » ccsid in MQMD or MQRFH2, what controls what?

Post new topic  Reply to topic
 ccsid in MQMD or MQRFH2, what controls what? « View previous topic :: View next topic » 
Author Message
MiLi
PostPosted: Thu Feb 02, 2006 1:49 am    Post subject: ccsid in MQMD or MQRFH2, what controls what? Reply with quote

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
View user's profile Send private message
elvis_gn
PostPosted: Thu Feb 02, 2006 1:54 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
MiLi
PostPosted: Thu Feb 02, 2006 2:02 am    Post subject: Reply with quote

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
View user's profile Send private message
elvis_gn
PostPosted: Thu Feb 02, 2006 3:15 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
MiLi
PostPosted: Thu Feb 02, 2006 4:27 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Feb 02, 2006 4:55 am    Post subject: Reply with quote

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
View user's profile Send private message
MiLi
PostPosted: Thu Feb 02, 2006 5:40 am    Post subject: Reply with quote

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
View user's profile Send private message
mvic
PostPosted: Thu Feb 02, 2006 6:02 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Thu Feb 02, 2006 6:43 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » ccsid in MQMD or MQRFH2, what controls what?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.