Author |
Message
|
WBI_developer |
Posted: Tue Nov 08, 2005 1:33 pm Post subject: MRM to BLOB without using the Message set |
|
|
 Apprentice
Joined: 02 Jun 2004 Posts: 25
|
Hello,
I have a requirement wherein I have to create a BLOB of the input MRM. I could use ASBITSTREAM but it requires the usage of message set. I do not want to do it like that as I want to recreate the original MRM message as BLOB no matter what ever type of message. Please let me know how I could do that.
Thanks,
Maguire |
|
Back to top |
|
 |
recallsunny |
Posted: Tue Nov 08, 2005 2:52 pm Post subject: |
|
|
 Disciple
Joined: 15 Jun 2005 Posts: 163 Location: Massachusetts
|
Do you explore the use of ResetContentDescriptor...?? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Nov 08, 2005 3:16 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
ASBITSTREAM does not require the use of a message set.
And even if it did, InputRoot.Properties contains all of the information you need to identify the message. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
WBI_developer |
Posted: Wed Nov 09, 2005 7:56 am Post subject: |
|
|
 Apprentice
Joined: 02 Jun 2004 Posts: 25
|
Hi,
Thanks a lot for your responses. I thought of using an RCD node but I didn't want to use an extra node also my requirement needed me to create blob with in compute node. As for ASBITSTREAM it wasn't accepting a direct conversion to BLOB. It is giving me a message that it cannot convert to bitstream unless the wireformat is mentioned. I could use BITSTREAM which is working fine but it seems to be giving different results when the original message has MQRFH2 header and when it does not. Please could somebody explain
Thanks,
Maguire |
|
Back to top |
|
 |
kimbert |
Posted: Wed Nov 09, 2005 8:05 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Instead of re-creating the input message, you could
- parse it as a BLOB
- save a copy of InputRoot.BLOB.BLOB (in the environment)
- use the RCD node (or CREATE...PARSE, if performance matters a lot) to parse the message against the message set.
- Refer to the BLOB in the environment any time you need it. |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Nov 09, 2005 8:29 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
BITSTREAM is deprecated. Don't use it.
Show the code that throws the error when trying to use ASBITSTREAM.
And I repeat, InputRoot.Properties will contain any information you need to give to ASBITSTREAM, which I think you don't need.
And also, ASBITSTREAM does not convert to BLOB. It returns a bitstream which IS a blob.
I suspect you're doing the wrong thing.
So show your code! _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
WBI_developer |
Posted: Wed Nov 09, 2005 10:53 am Post subject: |
|
|
 Apprentice
Joined: 02 Jun 2004 Posts: 25
|
Thank you. Here are the different ASBITSTREAM commands I used to make it work. none of them worked.
ASBITSTREAM(InputBody, InputRoot.MQMD.Encoding,InputRoot.MQMD.CodedCharSetId)
ASBITSTREAM(InputBody)
ASBITSTREAM(InputRoot.MRM CCSID InputRoot.MQMD.CodedCharSetId Encoding InputRoot.MQMD.Encoding)
for all these I get the same error :
[b]Invalid Wire Format Identifier ''. [/b]
Thanks in advance |
|
Back to top |
|
 |
JT |
Posted: Wed Nov 09, 2005 12:47 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
As Jeff stated, expand the ASBITSTREAM statement using the InputRoot.Properties to anonymously identify the messageset of the input message:- InputRoot.Properties.MessageSet
- InputRoot.Properties.MessageType
- InputRoot.Properties.MessageFormat
|
|
Back to top |
|
 |
WBI_developer |
Posted: Wed Nov 09, 2005 1:17 pm Post subject: |
|
|
 Apprentice
Joined: 02 Jun 2004 Posts: 25
|
Hi,
I think I did not explain my requirement clearly. I am trying to save my original message as BLOB when an error occurs. In the error handler I am trying to copy the original message as BLOB for which I am using ASBITSTREAM.
However, when I get parser exception and I try to create the BLOB with message set details it is again throwing exception because the message itself is not as per the message set. That is why I want the original message to be converted to BLOB without using the message set values. Can this be done at all?
Thanks,
Krishna |
|
Back to top |
|
 |
wschutz |
Posted: Wed Nov 09, 2005 4:07 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
If you put a trace node before the compute node and dump the ${Root}, what do you see?
(ie, cut and past the output here....) _________________ -wayne |
|
Back to top |
|
 |
kimbert |
Posted: Thu Nov 10, 2005 1:34 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Why does this not work:
Quote: |
Instead of re-creating the input message, you could
- parse it as a BLOB
- save a copy of InputRoot.BLOB.BLOB (in the environment)
- use the RCD node (or CREATE...PARSE, if performance matters a lot) to parse the message against the message set.
- Refer to the BLOB in the environment any time you need it. |
|
|
Back to top |
|
 |
jhosie |
Posted: Thu Nov 10, 2005 3:25 am Post subject: |
|
|
Apprentice
Joined: 12 May 2005 Posts: 28
|
You sould use the EmbeddedBitStream option
Code: |
SET OutputRoot.BLOB.BLOB=ASBITSTREAM(InputBody OPTIONS EmbeddedBitStream);
|
This code should give you the same bitstream that would be written to the queue by a MQOutputNode. So, assuming that you have not changed the message tree, that will probably be the original bitstream. (I'm not sure if that statement is always true e.g. if you are using validation or you have optional elements).
So you don't need to code the Set, Type, Format Encoding or CCSID ( or even Domain). |
|
Back to top |
|
 |
kimbert |
Posted: Thu Nov 10, 2005 3:30 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
I'm doubtful about trying to re-create the input message in an error flow. If I was trying to diagnose an error in the flow, I would want to be sure that I was looking at the real input message. Bear in mind that some errors in your flow might be the result of a parsing error, in which case the message tree might be badly-structured, and the result of ASBITSTREAM could easily differ from the real input message. |
|
Back to top |
|
 |
WBI_developer |
Posted: Thu Nov 10, 2005 6:32 am Post subject: |
|
|
 Apprentice
Joined: 02 Jun 2004 Posts: 25
|
Thanks a lot for all your responses. Kimbert, I liked your solution but I did not want to lose all the properties data which has the original message data. Also I didn't want to use another node as I am already making it pretty complex. After looking at all the solutions I feel that the best solution would be storing all the required values in Environment variables and use RCD node to convert to BLOB.
Thanks,
Maguire |
|
Back to top |
|
 |
|