Author |
Message
|
pratuluv |
Posted: Mon Sep 16, 2013 11:31 pm Post subject: XML Parser Exception |
|
|
Acolyte
Joined: 25 May 2011 Posts: 53
|
I have a very basic question. I am using a MQInput Node and the Input Message parsing is set to XMLNSC.
Now I am passing an Invalid XML (not a well formed XML) as input.
I have connected the failure terminal to FAILURE Q. I expected WMB to throw an error as the input is not a valid XML but it doesn't throw any error.
I am using WMB 8.0.0.2. Is this behaviour normal |
|
Back to top |
|
 |
Tibor |
Posted: Mon Sep 16, 2013 11:51 pm Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
Have you already checked the entries in syslog (Unix) or event viewer (Windows)? |
|
Back to top |
|
 |
Esa |
Posted: Mon Sep 16, 2013 11:55 pm Post subject: Re: XML Parser Exception |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
pratuluv wrote: |
Is this behaviour normal |
Yes. By connecting the failure terminal you are giving the broker instructions how to handle failed messages. Put a breakpoint or a trace node after the failure terminal and examine the exception list.
And, as Tibor pointed out, there should be something in the system log, too. |
|
Back to top |
|
 |
pratuluv |
Posted: Mon Sep 16, 2013 11:57 pm Post subject: |
|
|
Acolyte
Joined: 25 May 2011 Posts: 53
|
To explain it further,
I have a MQInput node ---> Compute Node ---> MQOuput Node.
I am just saying SET OutputRoot = InputRoot; in Compute Node.
The Failure terminal is connected to another MQOutput Node. So in case of Invalid XML, I expect broker to take the failure path but instead, the borker takes the out path and the message is sent to the Output Queue. |
|
Back to top |
|
 |
pratuluv |
Posted: Tue Sep 17, 2013 12:00 am Post subject: Re: XML Parser Exception |
|
|
Acolyte
Joined: 25 May 2011 Posts: 53
|
Esa wrote: |
pratuluv wrote: |
Is this behaviour normal |
Yes. By connecting the failure terminal you are giving the broker instructions how to handle failed messages. Put a breakpoint or a trace node after the failure terminal and examine the exception list.
And, as Tibor pointed out, there should be something in the system log, too. |
My point is Broker is not taking the failure path. It is processing the Invalid XML as any other good message and sending to the Output Queue and not the failure Q. |
|
Back to top |
|
 |
Simbu |
Posted: Tue Sep 17, 2013 12:07 am Post subject: Re: XML Parser Exception |
|
|
 Master
Joined: 17 Jun 2011 Posts: 289 Location: Tamil Nadu, India
|
pratuluv wrote: |
Esa wrote: |
pratuluv wrote: |
Is this behaviour normal |
Yes. By connecting the failure terminal you are giving the broker instructions how to handle failed messages. Put a breakpoint or a trace node after the failure terminal and examine the exception list.
And, as Tibor pointed out, there should be something in the system log, too. |
My point is Broker is not taking the failure path. It is processing the Invalid XML as any other good message and sending to the Output Queue and not the failure Q. |
I think in your MQInput node Parse Timing property set to On Demand.
Quote: |
On Demand causes partial parsing to occur. When fields in the message are referenced, as much of the message is parsed as is necessary to completely resolve the reference. Therefore, fields might not be parsed until late in the message flow, or never. This restriction applies to both the message body and the message headers. |
http://publib.boulder.ibm.com/infocenter/wmbhelp/v8r0m0/topic/com.ibm.etools.mft.doc/ac20814_.htm |
|
Back to top |
|
 |
Esa |
Posted: Tue Sep 17, 2013 12:13 am Post subject: Re: XML Parser Exception |
|
|
 Grand Master
Joined: 22 May 2008 Posts: 1387 Location: Finland
|
Simbu wrote: |
I think in your MQInput node Parse Timing property set to On Demand.
|
Exactly. If you do
Code: |
SET OutputRoot = InputRoot; |
the message is not necessarily parsed. It can be copied as a BLOB if you haven't touched any fields yet. |
|
Back to top |
|
 |
rekarm01 |
Posted: Tue Sep 17, 2013 2:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
pratuluv wrote: |
I have a MQInput node ---> Compute Node ---> MQOuput Node.
I am just saying SET OutputRoot = InputRoot; in Compute Node. |
The message flow won't parse the message unless it has to. In this case, the message flow can pass the unparsed bitstream from input to output.
pratuluv wrote: |
The Failure terminal is connected to another MQOutput Node. So in case of Invalid XML, I expect broker to take the failure path ... |
Even if the parser threw an exception, the message flow would either route it to the Catch terminal, or back to the input queue, not to the Failure terminal. If the message flow does route the message to the Failure terminal, it would be for some other reason, (such as Backout Threshold exceeded). |
|
Back to top |
|
 |
pratuluv |
Posted: Tue Sep 17, 2013 2:19 am Post subject: |
|
|
Acolyte
Joined: 25 May 2011 Posts: 53
|
Thanks everyone. I got it.
1. The parser option is On Demand so I tried changing it to Complete / Immediate and it throws an exception.
2. I kept the parser option as On Demand and added one more line of code in ESQL as below. It throws parser exception as expected.
Set OutputRoot = InputRoot;
Set OutputRoot.XMLNSC = InputRoot.XMLNSC;
Thanks for all your inputs and guidance. |
|
Back to top |
|
 |
|