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 » Parse Message body in flow

Post new topic  Reply to topic
 Parse Message body in flow « View previous topic :: View next topic » 
Author Message
angka
PostPosted: Tue Apr 29, 2008 12:08 am    Post subject: Parse Message body in flow Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

How do I parse InputBody to XML in compute node? The message has no MQRFH2 header or any other header and Input node nothing set. So when i debug thru, the message body is in BLOB.

From the document, it states:
"the message body is parsed when you refer to Root.XML.Field (or InputRoot.XML.Field in the Compute node) or Root.MRM.Field"

But i try to access e.g. SET AA = InputRoot.XML.A.B.C, AA has no value.

Thanks
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Apr 29, 2008 12:16 am    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Use a ResetContentDescriptor node
Back to top
View user's profile Send private message
angka
PostPosted: Tue Apr 29, 2008 12:21 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

But then why did the document states
"the message body is parsed when you refer to Root.XML.Field (or InputRoot.XML.Field in the Compute node) or Root.MRM.Field" ?

Thanks
Back to top
View user's profile Send private message
mgk
PostPosted: Tue Apr 29, 2008 12:33 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

You need to associate a parser with the incoming bitstream. If a msg has an RFH2 with the right information in it then the MQInput node will automatically try and choose the right parser for you. If there is no RFH2 then the node uses the parser options set on the node. Therefore, if you have an XML message you should choose XMLNSC (v6.1) or XMLNS (v6) on the node to associate the right parser with the message. If no parser is chosen, then BLOB is used. (And if you have a BLOB you can also use an RCD node to associate as parser with the bitstream as Tim said). However this process only associates the parser with the bitstream, it does not cause parsing to happen immediately. Actual parsing only happens when you "touch" (index into) the message in a node, such as a compute node with syntax like
Code:
SET AA = InputRoot.XMLNSC.A.B.C
This is called lazy parsing. You can override this behaviour on an input node to force "immediate parsing" but most of the time this lazy parsing is what most people need for best performance.

Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
angka
PostPosted: Tue Apr 29, 2008 12:47 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

Ya it is for best performance. my flow will not read all incoming message body that is why i wanna parse it in code level. so there is no way u can get it parse from BLOB to XML in compute node?

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 29, 2008 12:50 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

angka wrote:
so there is no way u can get it parse from BLOB to XML in compute node?


I would have though the example mgk quoted was probably in a compute node......

The clue seems to be:

mgk wrote:
Actual parsing only happens when you "touch" (index into) the message in a node, such as a compute node



_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Apr 29, 2008 1:32 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Create Field has a PARSE clause.

This likely isn't what you actually want, however.

And it's not clear why you think it's "better" to parse inside the compute node than it is to parse 'outside'.

Remember that the lazy parsing is still going to require that it parses everything that appears before the element you want. So if you touch InputBody.A.B.C.D, then it's going to parse everything necessary to find A, everythng necessary to find A.B, everything necessary to find A.B.C and etc.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
angka
PostPosted: Tue Apr 29, 2008 2:08 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi Vitor,

I know tt mgk are refering to compute node. What i meant is tt after i validate whether to parse the message body, I will need to add a RCD node and den a compute node to do the rest. If it can be parsed using esql i will only need a compute node.

Hi jefflowrey,

Ya I know it will parse the whole message body but the incoming message may not be in xml so i cant set it in the input node. And not all incoming messages i will need to read its message body so for performance reason i decide to parse it after the input node.

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 29, 2008 2:19 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

angka wrote:
If it can be parsed using esql i will only need a compute node.


mgk has already said that you must associate a parser with the message before it can be parsed.

angka wrote:
but the incoming message may not be in xml so i cant set it in the input node.


That's not what you said in your original post...!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
angka
PostPosted: Tue Apr 29, 2008 3:25 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

"associate a parser with the message" means using RCD right? What I meant is it may be xml or cwf format.

Thanks
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 29, 2008 3:29 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

angka wrote:
What I meant is it may be xml or cwf format.


And what I meant was you only mentioned XML in your very first post.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
angka
PostPosted: Tue Apr 29, 2008 5:00 am    Post subject: Reply with quote

Chevalier

Joined: 20 Sep 2005
Posts: 406

Hi,

Oh Sorry I din elaborate. =)
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 » Parse Message body in flow
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.