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 » Reading XML message from a queue using java in message broke

Post new topic  Reply to topic
 Reading XML message from a queue using java in message broke « View previous topic :: View next topic » 
Author Message
kbsiva
PostPosted: Mon Jun 29, 2009 7:35 am    Post subject: Reading XML message from a queue using java in message broke Reply with quote

Newbie

Joined: 29 Jun 2009
Posts: 6

I am fairly new to message broker. I have a flow A which basically has an java compute node sending XML data to the queue via an MQOutPutNode. Do I have to set the MQRFH2 header for the messages I am dropping in?

I can see my xml data in the queue which is well formed and valid. The problem starts in the second flow which reads from this queue using an MQInputNode and then there is a java compute node which process this message. The java compute node gives a null value when I try this,

inmessage.getRootElement.getElementByFirstPath("FIL_NM");

The queue does have data like this,
<FIL_NM>abc.txt</FIL_NM>
Any suggestions to debug or any pointers on this , thanks in advance!
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Jun 29, 2009 9:38 am    Post subject: Re: Reading XML message from a queue using java in message b Reply with quote

Grand High Poobah

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

kbsiva wrote:
Do I have to set the MQRFH2 header for the messages I am dropping in?


If you don't, you'll need to provide default parsing data.

kbsiva wrote:
Any suggestions to debug or any pointers on this


First step in any WMB problem is a user trace. I suspect in this instance the message hasn't been parsed as XML (see my comment above).

The user trace will tell the tale.

As an aside, if all you're doing is a simple transformation and output, you may find ESQL quicker & easier than Java. It's certainly more efficient for this sort of thing.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Tue Jun 30, 2009 12:20 am    Post subject: Re: Reading XML message from a queue using java in message b Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

Vitor wrote:

The user trace will tell the tale.


I think a trace node with ${Root} may be more helpful in this situation but I second your other points.


Last edited by WMBDEV1 on Tue Jun 30, 2009 12:52 am; edited 1 time in total
Back to top
View user's profile Send private message
er_pankajgupta84
PostPosted: Tue Jun 30, 2009 12:34 am    Post subject: Reply with quote

Master

Joined: 14 Nov 2008
Posts: 203
Location: charlotte,NC, USA

I believe your structure of the flow would be...

MQInput -> Java Node -> MqOutput. And most probably you have not done any parsing on the MQInput node.

Try adding the XML parser on the MQInput node otherwise blob message will enter in the java node and we cannot run XPath functions on blob message.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Vitor
PostPosted: Tue Jun 30, 2009 2:47 am    Post subject: Re: Reading XML message from a queue using java in message b Reply with quote

Grand High Poobah

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

WMBDEV1 wrote:
Vitor wrote:

The user trace will tell the tale.


I think a trace node with ${Root} may be more helpful in this situation but I second your other points.


IIRC a user trace still shows the parser in use (or not) but a trace node never hurts when you're debugging.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jun 30, 2009 2:48 am    Post subject: Reply with quote

Grand High Poobah

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

er_pankajgupta84 wrote:
Try adding the XML parser on the MQInput node


You of course mean the XMLNSC parser, rather than the XML parser retained for compatibility only.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
gs
PostPosted: Tue Jun 30, 2009 2:53 am    Post subject: Reply with quote

Master

Joined: 31 May 2007
Posts: 254
Location: Sweden

A user trace sounds like a little too much work for the task. Why not just put a breakpoint after the MQInput node and run a debug session to view the logical message structure?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jun 30, 2009 3:07 am    Post subject: Reply with quote

Grand High Poobah

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

gs wrote:
A user trace sounds like a little too much work for the task. Why not just put a breakpoint after the MQInput node and run a debug session to view the logical message structure?


Not a fan of the debugger personally - I always find it easier to use the trace. Couple of quick commands & you're there. Maybe I'm getting old....

....you also get more info for your money with trace IMHO.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
kbsiva
PostPosted: Tue Jul 14, 2009 2:24 pm    Post subject: Thanks! Reply with quote

Newbie

Joined: 29 Jun 2009
Posts: 6

Guys,
Thanks for all the help. I have it working now. I used the debugger, it shows the OutAssembly and if you do not have the headers set then it will show as null. I prefer that since it shows you the whole message structure.
Appreciate it.

Siva
Back to top
View user's profile Send private message
kimbert
PostPosted: Tue Jul 14, 2009 4:00 pm    Post subject: Reply with quote

Jedi Council

Joined: 29 Jul 2003
Posts: 5542
Location: Southampton

Vitor's right. The debugger is a useful tool for diagnosing many problems, but it should not be your only diagnosis tool.
The debugger only shows you *what* is happening.
User trace tells you *why* it is happening.
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 » Reading XML message from a queue using java in message broke
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.