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 » problem with MessageFlow

Post new topic  Reply to topic
 problem with MessageFlow « View previous topic :: View next topic » 
Author Message
pfaulkner
PostPosted: Thu Aug 15, 2002 1:35 pm    Post subject: problem with MessageFlow Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

Hi,

I have a message flow that takes a message and parses it in two parts. All my messages that go through WMQI will have a header that needs to be parsed seperately to the rest of the message (the header will never need to be converted to another data type like the rest of the message).

I parsed my message with out any problems but when I do the final MQOutput node I end up with a message with no data.

To put the msg back together I used this COMPUTE node:
DECLARE I INTEGER;
SET I = 1;
WHILE I < CARDINALITY(InputRoot.*[]) DO
SET OutputRoot.*[I] = InputRoot.*[I];
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.BLOB.Message.Header = Environment.MRM;
Set OutputRoot.BLOB.Message.Data = InputBody;

Then I put a Trace node between this COMPUTE node and my final MQOutput Node which shows the Body as:

Body =>
(
(0x1000000)Message = (
(0x1000000)Header = (
(0x3000000)registryEyeCatcher = 'RMSGTR01'
(0x3000000)version = '0100'
(0x3000000)msgTranHdrLen = '0000296'
(0x3000000)msgApplDataLen = '0001024'
(0x3000000)domain = ' '
(0x3000000)serviceName = 'ECHO '
(0x3000000)serviceQualifier = 'CITMCSAC '
(0x3000000)msgType = 'Q'
(0x3000000)dialogType = 'S'
(0x3000000)dialogId = 'RJ2271540100010A1B600000'
(0x3000000)priority = '08'
(0x3000000)persistenceIndicator = 'Y'
(0x3000000)msgDataType = 'RGCH'
(0x3000000)msgApplFormat = ' '
(0x3000000)serviceVersion = ' '
(0x3000000)userId = 'faulkner '
(0x3000000)applId = 'AIcose2e1 N '
(0x3000000)ownerApplName = 'TESTAPPL '
(0x3000000)processName = 'TESTPROC '
(0x3000000)externalRef = ' '
(0x3000000)codePage = '0000'
(0x3000000)replyCompCode = '0000'
(0x3000000)replyReasonCode = '00000000'
(0x3000000)rtsOrigDate = '20020815154010816'
(0x3000000)routingStackTbl = '064MQSCOS1 RGSH.REPLY.QUEUE.0007 '
)
(0x1000000)Data = (
(0x3000000)BLOB = X'20203030303030303030204142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f505152535455565758595a4142434445464748494a4b4c4d4e4f50515253545556575859'
)
)
)


What am I missing and why doesn't the body end up as my msg data?
Back to top
View user's profile Send private message AIM Address
sgopal
PostPosted: Thu Aug 15, 2002 2:14 pm    Post subject: Reply with quote

Acolyte

Joined: 30 Jul 2002
Posts: 63

Can you try with the following:

1. SET OutputRoot.Properties.MessageDomain = 'BLOB';

2. CAST(Environment.MRM as BLOB); or
BITSTREAM(Environment.MRM);
Back to top
View user's profile Send private message
philip.baker
PostPosted: Thu Aug 15, 2002 2:29 pm    Post subject: Reply with quote

Voyager

Joined: 21 Mar 2002
Posts: 77
Location: Baker Systems Consulting, Inc. - Tampa

It looks to me like your data is there.

You've got a couple blanks followed by 8 zeroes and another blank. Then the alphabet from a to z is repeated about 38 times. Its just in hex format.
How would you like the data to be presented to the OutputNode?

Regards,
Phil
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
kirani
PostPosted: Thu Aug 15, 2002 2:47 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Paul,

BITSTREAM function can be used only on Message tree (Input or Output). It cannot be used with Environment, LocalEnvironment and local variables. If planning to use CAST function, you will have to use it with CCSID.
If above solution doesn't work, try adding a RCD node after Compute node and reset domain to BLOB.

If this doesn't solve your problem then it would be helpful if you could explain your current message flow.
What is your input and output message format?
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
pfaulkner
PostPosted: Fri Aug 16, 2002 8:15 am    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

Tried the CAST and and also tried adding a RCD after the Compute, neither seemed to work. After the RCD, I used another Trace node to check the content and it was BLOB x''.

This is what I am trying to do...

Every Msg input contains two parts, a header and some msg data. The header will always be in a C format and will need to be parsed to do some data manipulation. The msg Data part could be in either C or XML and needs to be parsed for transformation to C or XML.

In this Flow I am simply trying to parse the two parts of the message both are coming in as a C format and put the message back together.

This is what I have:

1. COMPUTE NODE TO PULL OUT HEADER

DECLARE I INTEGER;
SET I = 1;
WHILE I < CARDINALITY(InputRoot.*[]) DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
SET OutputRoot.Properties.MessageSet = 'DP3PD5007G001';
SET OutputRoot.Properties.MessageType = 'registryMQHeader';
-- Enter SQL below this line. SQL above this line might be regenerated, causing any modifications to be lost.

-- Copy mesage to Environment.BLOB
Set Environment.BLOB = InputBody.BLOB;

-- Reset OutputRoot.BLOB.BLOB to header (1st 296 bytes)
Set OutputRoot."BLOB"."BLOB" = substring(InputBody.BLOB from 1 for 296);

-- Set new message format to CWF (MsgSet already set above)
Set OutputRoot.Properties.MessageFormat = 'CWF';


2. RCD TO RESET MESSAGE DOMAIN TO MRM & MESSAGE FORMAT TO CWF

3. COMPUTE NODE TO PULL OUT BODY

DECLARE I INTEGER;
SET I = 1;
WHILE I < CARDINALITY(InputRoot.*[]) DO
SET OutputRoot.*[I] = InputRoot.*[I];
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 Environment.MRM to the Header
Set Environment.MRM = InputBody;

-- Set Output.BLOB.BLOB to Message Data (from Environment.BLOB copied in Pull Out Header)
Set OutputRoot.BLOB.BLOB = substring(Environment.BLOB from 297 for length(Environment.BLOB)-296);

4. RCD TO RESET MESSAGE DOMAIN TO BLOB & MESSAGE FORMAT TO BLOB

5. COMPUTE NODE TO COMBINE HEADER AND DATA (THIS IS WHERE I SEEM TO GET INTO TROUBLE)

DECLARE I INTEGER;
SET I = 1;
WHILE I < CARDINALITY(InputRoot.*[]) DO
SET OutputRoot.*[I] = InputRoot.*[I];
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."BLOB".Message.Header = CAST(Environment.MRM AS BLOB);
Set OutputRoot."BLOB".Message.Data = InputBody;

Set OutputRoot.Properties.MessageDomain = 'BLOB';
Back to top
View user's profile Send private message AIM Address
kirani
PostPosted: Fri Aug 16, 2002 11:55 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Paul,

This is how I would recommend you to design your message flow.

MQInput(BLOB)->Floworder1(first)->Compute1->RCD1->Compute2
Floworder1(second)->Compute3->RCD2->Compute4->Compute5->MQOutput (output q)
MQInput(catch)->Trace->MQOutput (catch q)

Use a Flow order node to output MRM message and Store it into Environment Tree.

First Read your input message as BLOB from the input queue.

In compute1 node, select Copy Message Headers only and Extract the header part of the message using ESQL:
SET OutputRoot.BLOB.BLOB = SUBSTRING(InputBody FROM 1 FOR 296);

Use RCD to parse input Header message using appropriate MRM message definition
Reset MesageDomain to MRM...etc.

In compute2 node, store your parsed MRM Header message in Environment Tree.
SET Environment.MRM = InputRoot.MRM;


In another path, in Compute3 node, extract message Body from input message.
SET OutputRoot.BLOB.BLOB = SUBSTRING(Inputbory FROM 297 );

Using RCD2 node, reset your message domain to MRM and apply appropriate MRM parser to parse input MRM body message.

In Compute4 node, create your output MRM message using simple mapping ESQL.
SET OutputRoot.MRM.....

In Compute5 node, combine Header and Body messages ...
SET OutputRoot."BLOB"."BLOB" = CAST(Environment.MRM AS BLOB CCSID InputRoot.Properties.CodedCharSetId) || BITSTREAM(InputBody);

Hope this helps.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
kirani
PostPosted: Fri Aug 16, 2002 12:32 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Paul,

I think the code needs to be changed a little,

We will change ..
Quote:

SET Environment.MRM = InputRoot.MRM;


to
SET Environment.MRM = BISTREAM(InputRoot.MRM);

and

Quote:

SET OutputRoot."BLOB"."BLOB" = CAST(Environment.MRM AS BLOB CCSID InputRoot.Properties.CodedCharSetId) || BITSTREAM(InputBody);


to
SET OutputRoot."BLOB"."BLOB" = Environment.MRM || BITSTREAM(InputBody);
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
pfaulkner
PostPosted: Fri Aug 16, 2002 12:38 pm    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

Cool....thanks I really appreciate the help.

I did get my current design to work by changing my final compute node (to put everything together) to do this:

Set OutputRoot."BLOB"."BLOB" = CAST(Environment.MRM.registryEyeCatcher AS BLOB CCSID 819) ||
CAST(Environment.MRM.version AS BLOB CCSID 819) ||
CAST(Environment.MRM.msgTranHdrLen AS BLOB CCSID 819) ||
CAST(Environment.MRM.msgApplDataLen AS BLOB CCSID 819) ||
CAST(Environment.MRM.domain AS BLOB CCSID 819) ||
CAST(Environment.MRM.serviceName AS BLOB CCSID 819) ||
CAST(Environment.MRM.serviceQualifier AS BLOB CCSID 819) ||
CAST(Environment.MRM.msgType AS BLOB CCSID 819) ||
CAST(Environment.MRM.dialogType AS BLOB CCSID 819) ||
CAST(Environment.MRM.dialogId AS BLOB CCSID 819) ||
CAST(Environment.MRM.priority AS BLOB CCSID 819) ||
CAST(Environment.MRM.persistenceIndicator AS BLOB CCSID 819) ||
CAST(Environment.MRM.msgDataType AS BLOB CCSID 819) ||
CAST(Environment.MRM.msgApplFormat AS BLOB CCSID 819) ||
CAST(Environment.MRM.serviceVersion AS BLOB CCSID 819) ||
CAST(Environment.MRM.userId AS BLOB CCSID 819) ||
CAST(Environment.MRM.applId AS BLOB CCSID 819) ||
CAST(Environment.MRM.ownerApplName AS BLOB CCSID 819) ||
CAST(Environment.MRM.processName AS BLOB CCSID 819) ||
CAST(Environment.MRM.externalRef AS BLOB CCSID 819) ||
CAST(Environment.MRM.codePage AS BLOB CCSID 819) ||
CAST(Environment.MRM.replyCompCode AS BLOB CCSID 819) ||
CAST(Environment.MRM.replyReasonCode AS BLOB CCSID 819) ||
CAST(Environment.MRM.rtsOrigDate AS BLOB CCSID 819) ||
CAST(Environment.MRM.routingStackTbl AS BLOB CCSID 819) ||
InputBody.BLOB;
Back to top
View user's profile Send private message AIM Address
pfaulkner
PostPosted: Fri Aug 30, 2002 11:09 am    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

Now I am trying to add transformation on the data part of the message. I have been successful in converting my Request message data from XML to C but having problems converting from C back to XML.

I still strip the header and data the same way but before putting the message back together I convert my C msgdata back to XML (which all seems to work fine).

I use the following line to put the header and data part of the message back together:

SET OutputRoot."BLOB"."BLOB" = Environment.MRM || BITSTREAM(InputBody);

Problem is the data part of my output message which is in XML contains the doctype info and not just the data...

<?xml version="1.0"?><|DOCTYPE MRM PUBLIC "DP3PD50....


What do I need to do in order to only get the data part of the xml message???

thanks
Back to top
View user's profile Send private message AIM Address
kirani
PostPosted: Sun Sep 01, 2002 7:18 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Paul,

Are you transforming your C msgdata (MRM-CWF) to MRM-XML?
There is an option in wire format tab (XML) of the message set to supress generation of XML header.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
pfaulkner
PostPosted: Wed Sep 04, 2002 11:28 am    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

Yes I am transforming to MRM-XML

I set the 'suppress doctype' and 'suppress XML Declaration' both to YES on the Message Set but now I get this in my message:

<|--MRM Generated XML Output on :Wed Sep 4 13:55:
Back to top
View user's profile Send private message AIM Address
kirani
PostPosted: Wed Sep 04, 2002 12:21 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Interesting problem!

I don't see any option to suppress Timestamp comment at Message Set level.
Code:

<!-- MRM Generated XML Output on :Wed Sep 04 13:12:46 2002-->


I think, CSD3 allows you to suppress this comment line. CSD Release guide says:
Quote:

You can choose not to include a timestamp comment in your XML output by setting the Suppress Timestamp Comment property.


If you want to solve the problem at CSD2 level then you will have to code some logic within message flow to do this. You will remove this comment by first converting the message to BLOB and then search for first occurance of > character in it. Let's say the position returned is pos. Do a SUBSTRING from pos+1 to end of message and creae a new message body.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
pfaulkner
PostPosted: Wed Sep 04, 2002 12:26 pm    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

ok, thanks!

I think I should install CSD3 anyway.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » problem with MessageFlow
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.