Author |
Message
|
RocknRambo |
Posted: Wed Feb 03, 2010 1:32 pm Post subject: XML validation |
|
|
Partisan
Joined: 24 Sep 2003 Posts: 355
|
we are having mixed opinion in our team in regards to message (XML) validation in the input node.
The discussion is around, do we need to validate every single XML message against the predefined XSD sent from the source system. Listing in the Pros/Cons - Might impact performance (though MBv7 claims much better Parsers, restricting the developer to create a message set for every transformation needs, better error management, if the source system has changed XSD without communicating with Middleware team)
Any one has better thoughts on the need for validating every single message (XML) if the source is trusted and services are secured
--
Rock |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 03, 2010 1:48 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
My 2 cents:
If you've got an XSD you should validate the message. The performance hit is negligable and even if it's a trusted source there's a good chance (as you intimate) that the XSD will change at some point & you'll accidently not be given the new one.
One counter to this I've heard was that if the XSD changes frequently the burden on WMB administration becomes too high. My response is that if it changes that often it's even more essential to validate the message and weed out those that can't be processed!
Other points of view may be equally valid, etc, etc. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kimbert |
Posted: Wed Feb 03, 2010 2:16 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Since you will be using XMLNSC, schema validation is cheap - typically ~25% extra CPU cost. However, don't take my word for it - it's simple to run a few throughput tests with validation enabled/disabled.
Once you know the real cost, only you and your team can decide whether it's worth it.
You might want to consider this: if you don't validate the incoming messages, then your message flow logic might need to do a lot more checking of its inputs. That extra checking will consume CPU. But if the schemas are not particularly strict, then you'll need to have do most of the required error checking in your flow either way. |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Feb 03, 2010 2:26 pm Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
If you don't use XMLNSC Validation then you have just made Broker the fall guy.
If an upstream team changes their message structure and then sends the new format to you and you don't detect this then the all the pressure to fix it will be on you even thouh it is not your fault.
On the otherhand if you use validation then you will quickly pick up that the foramt of the message has changed and then you will be in a much better position to challenge the team who made the changes without your involvement. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
nathanw |
Posted: Thu Feb 04, 2010 12:29 am Post subject: |
|
|
 Knight
Joined: 14 Jul 2004 Posts: 550
|
smdavies99 wrote: |
If you don't use XMLNSC Validation then you have just made Broker the fall guy.
If an upstream team changes their message structure and then sends the new format to you and you don't detect this then the all the pressure to fix it will be on you even thouh it is not your fault.
On the otherhand if you use validation then you will quickly pick up that the foramt of the message has changed and then you will be in a much better position to challenge the team who made the changes without your involvement. |
and thus maybe put a stop to the automatic problem with MQ and Broker that theya re always blamed if there is a problem. _________________ Who is General Failure and why is he reading my hard drive?
Artificial Intelligence stands no chance against Natural Stupidity.
Only the User Trace Speaks The Truth  |
|
Back to top |
|
 |
|