Author |
Message
|
WBI_user |
Posted: Fri Dec 28, 2007 10:25 am Post subject: recreating original message |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
I am using WMB V6 with CSD 5 on winxp
I was given a BLOB of an entire message including the header. It was created with asbitstream or bitstream of inputroot. I need to recreate the original message from it.
The message can be from any platform. So my approach is
1. recreate the mqmd to get the ccsid and encoding info
2. recreate the message body
I use the create function
SET MSGBLOB= the bit stream that was given to me
CREATE NEXTSIBLING OF OutputRoot.Properties DOMAIN('MQMD') PARSE(MSGBLOB)
This recreated the MQMD fine except the ccsid and encoding is 437 and 546 (I think this comes from wondows). But my message actually was from UNIX and has CCSID and Encoding of 819 and 273. I read the info center on create and parse function and found it very confusing on the parse clause. Since I do not know the CCSID and Encoding of the original BLOB, I cannot provide it as input parameter to the parse clause. I know I can examine the bitstream to get the ccsid and encoding out first. But I like to know if there is a better way to do this before I do that.
Any suggestion ? Is my approach the long way ? |
|
Back to top |
|
 |
vsr |
Posted: Fri Dec 28, 2007 12:18 pm Post subject: Re: recreating original message |
|
|
Centurion
Joined: 04 Apr 2006 Posts: 104
|
WBI_user wrote: |
This recreated the MQMD fine except the ccsid and encoding is 437 and 546 (I think this comes from wondows). But my message actually was from UNIX and has CCSID and Encoding of 819 and 273. |
If you check InputRoot.Properties for encoding and ccsid, you will find the values matching their originating system. For example, if the broker gets messages from windows system then you will find encoding as 546 and ccsid as 819. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 28, 2007 12:27 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Quote: |
It was created with asbitstream or bitstream of inputroot. I need to recreate the original message from it |
Which means that somebody had to create the bitstream with a CCSID and Encoding...
So make sure the CCSID and Encoding are as translation neutral as possible (UTF-8 =1208, Unicode =1200 ...) and do not loose characters from the original. Then you can hardcode... both the formatter and parser sides...
However there is also the possibility (preferred) of just using the values of InputRoot.Properties or InputRoot.MQMD...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
WBI_user |
Posted: Fri Dec 28, 2007 12:56 pm Post subject: |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
Hi vsr abd fjb_saper, I shouldbe more specific about how I got the message blob. I retrieve it from the DB using a message flow
mqinput - db - mqoutput.
The mqoutput shoudl contain the original message I want.
The input message contains the msgid or timestamp of the message that I need to retrieve from DB and hence the CCSID or ENC from InputRoot or properties folder is only for the platform where I run the flow which is windows. The entire message was stored in DB as blob together with msgid and timestamp. I have to make the assumption that the BLOB in the DB column contains bitstream created with the right CCSID and Encoding of the original message. Base on your answers, I think I need to determine the CCSID and the ENC before I recreate the MQMD ( the long way as mentioned in my original post).
I'll start the coding. Any other suggestion will be greatly appreciated. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 28, 2007 1:34 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
WBI_user wrote: |
Hi vsr abd fjb_saper, I shouldbe more specific about how I got the message blob. I retrieve it from the DB using a message flow
mqinput - db - mqoutput.
The mqoutput shoudl contain the original message I want.
The input message contains the msgid or timestamp of the message that I need to retrieve from DB and hence the CCSID or ENC from InputRoot or properties folder is only for the platform where I run the flow which is windows. The entire message was stored in DB as blob together with msgid and timestamp. I have to make the assumption that the BLOB in the DB column contains bitstream created with the right CCSID and Encoding of the original message. Base on your answers, I think I need to determine the CCSID and the ENC before I recreate the MQMD ( the long way as mentioned in my original post).
I'll start the coding. Any other suggestion will be greatly appreciated. |
You need to add 2 colums to your DB: CCSID and Encoding.
So now when you serialize you know what CCSID/Encoding you serialized and can add this to the DB.
At the same time when you retrieve the BLOB the additional columns will give you the CCSID and Encoding to use to parse it.
If you were using a CLOB in the DB I would probably suggest that you use UTF-8 across the board and maybe even hard code it... assuming your DB will accept UTF-8
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
WBI_user |
Posted: Fri Dec 28, 2007 1:46 pm Post subject: |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
Thanks fjb_saper, I do not do the DB part but I definitely can provide input to the other team. I'll ask them to add the CCSID and ENC column. They prepare the bitstream using bitstream (v2) or asbitstream (V6) on the inputroot. and are now storing the entire message as BLOB. I am not a DB person, is there any advantage of storing it as CLOB. Do they have to cast the entire message as character before they do the DB insert ? We have all kinds of messages from various platforms. These include CWF, XML, TDS and some binary images as data. Is it possible to do CLOB ? |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 28, 2007 1:56 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
WBI_user wrote: |
Thanks fjb_saper, I do not do the DB part but I definitely can provide input to the other team. I'll ask them to add the CCSID and ENC column. They prepare the bitstream using bitstream (v2) or asbitstream (V6) on the inputroot. and are now storing the entire message as BLOB. I am not a DB person, is there any advantage of storing it as CLOB. Do they have to cast the entire message as character before they do the DB insert ? We have all kinds of messages from various platforms. These include CWF, XML, TDS and some binary images as data. Is it possible to do CLOB ? |
CLOB should only be used if your message is a text message and preferably XML. Most DBs have now an XML package...
In case of a CWF message it is DANGEROUS to do a CCSID translation from the original.
Exemple:
Original message contains special char in EBCDIC (CCSID 500)
It gets translated as in into UTF-8
It get read as UTF-8 and parsed with the cobol copy book as UTF-8...
However the copy-book parser (CWF) is positional. You get a ton of errors ....
What happened?
UTF-8 is a multi byte character set
EBCDIC (CCSID 500) is a single byte character set.
As your only field identifiers are positional and you had a multibyte character (special char) in the UTF-8 version all the remaining part of your message just shifted down 1 or more bytes.
Had you transformed the message back to CCSID 500 before the copy book parsing you would have seen no shifting and no errors....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PravinG |
Posted: Thu May 29, 2008 4:04 pm Post subject: |
|
|
Newbie
Joined: 16 Oct 2006 Posts: 9 Location: India
|
Hello WBI_user,
I am having EXACTLY similar situation as you had in this case. Could you please let me know how you extracted the message body out of that BLOB ?
I am also able to extract the MQMD header. Also, as I am the one who is putting the BLOB message into database, I am having the CCSID and Encoding of the original message.
Help from anyone else is also greatly appriciated here.
Thanks,
Pravin. |
|
Back to top |
|
 |
WBI_user |
Posted: Wed Jun 04, 2008 4:26 am Post subject: |
|
|
Partisan
Joined: 07 Aug 2001 Posts: 386
|
I pursue this with IBM and an APAR IC55636 was taken. It was closed as Documentation update. I haven't had a chance to download the latest Info Center to see what the update is. What I found so far is I need to have the original CCSID and Encoding which I used to creates the blob. I can then recreate the MQMD and output the message body as BLOB or other formats. Also the recreation is only successful if the message blob was created on the same platform as the later recreation. In my case all the brokers that I need this function are on AIX. So it posts no problem to us at this time. The only inconvenience is I can not test the flow which recreate the message on my Windows sandbox. |
|
Back to top |
|
 |
MrSmith |
Posted: Mon Jun 09, 2008 3:17 am Post subject: |
|
|
 Master
Joined: 20 Mar 2008 Posts: 215
|
You could as an alternative crate your own java node if the amount of business benefit justifies this in that the the database encoding and other DB related information could be extracted as part of a jdbc connection. You can also then retrieve columns that are of CLOB type as most of the jdbc packages for DB's contain a BLOB and CLOB class. Just a thought. |
|
Back to top |
|
 |
PravinG |
Posted: Mon Jun 09, 2008 7:11 pm Post subject: |
|
|
Newbie
Joined: 16 Oct 2006 Posts: 9 Location: India
|
|
Back to top |
|
 |
|