Author |
Message
|
bkmikesell |
Posted: Wed Jan 28, 2004 10:18 am Post subject: Converting BLOB to MRM |
|
|
Newbie
Joined: 28 Jan 2004 Posts: 3
|
Our flow reads in a message as a blob, and based on a substring within the blob, it maps to one of two MRM messages. We are using the following code to do that blob to mrm conversion:
############################################
DECLARE I INTEGER;
SET I = 1;
WHILE I < CARDINALITY(InputRoot.*[]) DO
SET OutputRoot.* = InputRoot.*;
SET I=I+1;
END WHILE;
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputRoot.Properties.MessageSet = 'DTETF5G080001';
SET OutputRoot.Properties.MessageType = 'SVCPAYEADDFULL_MSG';
SET OutputRoot.Properties."MessageDomain" = 'MRM';
SET OutputRoot.Properties.MessageFormat = 'CWF';
SET "OutputRoot"."MRM" = InputRoot."BLOB"."BLOB";
###############################################
The following is a trace of $Root after the above code is executed in a compute node:
###############################################
(
(0x1000000)Properties = (
(0x3000000)MessageSet = 'DTETF5G080001'
(0x3000000)MessageType = 'SVCPAYEADDFULL_MSG'
(0x3000000)MessageFormat = 'CWF'
(0x3000000)Encoding = 546
(0x3000000)CodedCharSetId = 437
(0x3000000)Transactional = FALSE
(0x3000000)Persistence = FALSE
(0x3000000)CreationTime = GMTTIMESTAMP '2004-01-28 17:53:37.480'
(0x3000000)ExpirationTime = -1
(0x3000000)Priority = 0
(0x3000000)ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x3000000)ReplyProtocol = 'MQ'
(0x3000000)Topic = NULL
)
(0x1000000)MQMD = (
(0x3000000)SourceQueue = 'CMM.PAYEADPT.PAYECOB.REQ.AQ1'
(0x3000000)Transactional = FALSE
(0x3000000)Encoding = 546
(0x3000000)CodedCharSetId = 437
(0x3000000)Format = 'MQSTR '
(0x3000000)Version = 2
(0x3000000)Report = 0
(0x3000000)MsgType = 8
(0x3000000)Expiry = -1
(0x3000000)Feedback = 0
(0x3000000)Priority = 0
(0x3000000)Persistence = 0
(0x3000000)MsgId = X'414d512043425457434d4d3020202020a6d0164082400800'
(0x3000000)CorrelId = X'000000000000000000000000000000000000000000000000'
(0x3000000)BackoutCount = 0
(0x3000000)ReplyToQ = ' '
(0x3000000)ReplyToQMgr = 'CBTWCMM0 '
(0x3000000)UserIdentifier = 'MUSR_MQADMIN'
(0x3000000)AccountingToken = X'160105150000008c326861a12c2a721d4bd0249e04000000000000000000000b'
(0x3000000)ApplIdentityData = ' '
(0x3000000)PutApplType = 28
(0x3000000)PutApplName = 'MQSeries Client for Java '
(0x3000000)PutDate = DATE '2004-01-28'
(0x3000000)PutTime = GMTTIME '17:53:37.480'
(0x3000000)ApplOriginData = ' '
(0x3000000)GroupId = X'000000000000000000000000000000000000000000000000'
(0x3000000)MsgSeqNumber = 1
(0x3000000)Offset = 0
(0x3000000)MsgFlags = 0
(0x3000000)OriginalLength = -1
)
(0x1000021)MRM =
)
###############################################
MRM is empty. Any ideas? Thx. |
|
Back to top |
|
 |
Missam |
Posted: Wed Jan 28, 2004 10:24 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Why are you using compute node to do this.You can use RCD instead.
Try using
SET "OutputRoot"."MRM"."SVCPAYEADDFULL_MSG" = InputRoot."BLOB"."BLOB"; |
|
Back to top |
|
 |
bkmikesell |
Posted: Wed Jan 28, 2004 10:41 am Post subject: |
|
|
Newbie
Joined: 28 Jan 2004 Posts: 3
|
No luck. SVCPAYEADDFULL_MSG is the message name....not a field within MRM. This resulted in the field MRM.SVCPAYEADDFULL_MSG being set to the blob.
We are using a compute because we are parsing the blob as a different MRM message based on a substring within the blob (see original message). The code sample below doesn't show the substringing part. |
|
Back to top |
|
 |
Missam |
Posted: Wed Jan 28, 2004 11:31 am Post subject: |
|
|
Chevalier
Joined: 16 Oct 2003 Posts: 424
|
Quote: |
based on a substring within the blob
|
because we can't do any validations on blob how would you know to which mrm your message goes.
we have a requrement where we dynamically assign properties information in compute node.what we do is we check copy entire message radio button and assign properties information below
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.
SET OutputRoot.Properties.MessageSet = 'DTETF5G080001';
SET OutputRoot.Properties.MessageType = 'SVCPAYEADDFULL_MSG';
SET OutputRoot.Properties."MessageDomain" = 'MRM';
SET OutputRoot.Properties.MessageFormat = 'CWF';
[/quote] |
|
Back to top |
|
 |
mverh |
Posted: Wed Jan 28, 2004 12:20 pm Post subject: |
|
|
Voyager
Joined: 06 Mar 2002 Posts: 97
|
Setting the properties in the compute node alone won't do it since you will also have to build the output tree, in your case OutputRoot.MRM...requiring you to parse the entire blob. A simpler solution may be to build and set a destination list in your compute node based on the input message and then use a route to label and label nodes that routes your blob to the appropriate RCD node. _________________ Marc Verhiel
IBM Canada Ltd. |
|
Back to top |
|
 |
EddieA |
Posted: Wed Jan 28, 2004 12:54 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Take a look at the PARSE command. That will take your BLOB and parse it against the MRM definition.
Code: |
CREATE LASTCHILD OF OutputRoot DOMAIN 'MRM' PARSE(InputBody.BLOB,
InputProperties.Encoding,
InputProperties.CodedCharSetId,
'DQ5TMTK09M001', 'ACI_HEADER_MSG', 'CWF'); |
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
rajaram |
Posted: Thu Jan 29, 2004 5:31 am Post subject: |
|
|
Acolyte
Joined: 02 Jan 2004 Posts: 53
|
Hi,
One of the alternatives i can think of is you can use FILTER NODE to check for the substring and then use RCD to build the MRM structure. But in this case u need 2 filter nodes followed by 2 RCDs. In the filter nodes, you can check for substring.
First you have a
fILTER NODE1--IF TRUE--> RCD1 --->NEXT NODE
|
if false
|
filter node2---if true--> RCD2--->NEXT NODE
|
IF FALSE->tO ERROR QUEUE
The NEXT NODES i have mentioned are both same.
this will work, But i am not sure how far this is efficient
Thanks
raja |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 29, 2004 7:10 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
rajaram wrote: |
One of the alternatives i can think of is you can use FILTER NODE to check for the substring and then use RCD to build the MRM structure. |
rajaram wrote: |
But i am not sure how far this is efficient
|
Filter nodes get very inefficient quickly the more you layer them. That is, it's okay to use two nested filter nodes, but you should think hard about using RouteToLabel if you're nesting three. And you should definitely use RouteToLabel if you're nesting more than three! _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fschofer |
Posted: Thu Jan 29, 2004 8:09 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
If you want to get your BLOB parsed by MRM you simply have to set the Message Set properties
like you have done and copy the complete InputRoot.BLOB to OutputRoot.BLOB.
Put a trace node behind your compute Node. There you will see the parsed data. |
|
Back to top |
|
 |
bkmikesell |
Posted: Tue Feb 10, 2004 6:20 am Post subject: |
|
|
Newbie
Joined: 28 Jan 2004 Posts: 3
|
All good suggestions. I guess it comes down to this: Our design says to do the blob substring evaluation and parse accordingly within the same compute node, so that's what we're trying to do. As a workaround, we are using a route to label and rcd for each type of message (as someone suggested in this thread) and it works, but the point of my post was to see why my method doesn't work. I agree with the last post except that I'm converting to MRM, so I wouldn't want to set an Output BLOB = an Input BLOB, which is why our code says to set OutputRoot.MRM to InputRoot.BLOB.BLOB.
Thanks for everyone's response. |
|
Back to top |
|
 |
fschofer |
Posted: Mon Feb 16, 2004 2:29 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
You cannot directly copy BLOB data to OutputRoot.MRM except if your want your BLOB data as a single string in one of you MRM fields.
You can use the CREATE function as mentioned above to create MRM fields.
But the usual used method to parse a complete BLOB to a MRM tree is like i described.
Once your message leaves your compute node (as BLOB) and hits the next node which tries to access a part of your MRM tree (like a trace node with ${Root}) your message gets converted from BLOB to MRM.
This happens because you have set the Message properties in your code.
By the way, the third line (Domain) is not needed.
Code: |
SET OutputRoot.Properties.MessageSet = 'DTETF5G080001';
SET OutputRoot.Properties.MessageType = 'SVCPAYEADDFULL_MSG';
SET OutputRoot.Properties."MessageDomain" = 'MRM';
SET OutputRoot.Properties.MessageFormat = 'CWF'; |
|
|
Back to top |
|
 |
|