|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Performance Issue using XPATH in Message Broker (WBIMB) |
« View previous topic :: View next topic » |
Author |
Message
|
samgn123 |
Posted: Fri Dec 12, 2008 1:53 am Post subject: Performance Issue using XPATH in Message Broker (WBIMB) |
|
|
Newbie
Joined: 04 Nov 2008 Posts: 8
|
I am facing Performance Problems with respect to the XPATH Parsing . I have the Business requirement as -- " To Parse the Whole XML Message to Search Whether a Given XML Element or an XML Attribute is equal to/contains/starts with the Specified Value " . T
The requirement specifies whether the Search has to be done with XML Element or Attribute . But the Full Path of the XML Element / Attribute is not specified. That is the reason I have to parse the entire XML Message using Descendent Parsing in XPATH ( // <Element-name> ). That is actually not recommended , but I am left with no other option, as I don't have the Full Path Sepcified.
The Time taken to process the XML Message of around 600k is 5 to 6 sec, Where as the Performance Requirement is around 60ms
But If I comment out the XPATH Parsing , the message is Getting parsed in 60ms.
Due to this, I also thought of an Alternative approach ,as treating the Whole Message as String and using ESQL and implement the Logic using String Handling Functions. But this approach looks a bit weird.
Please let me know your thoughts on this, as Performance is very Critical..
|
|
Back to top |
|
 |
kimbert |
Posted: Fri Dec 12, 2008 3:08 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I have the Business requirement as -- " To Parse the Whole XML Message to Search Whether a Given XML Element or an XML Attribute is equal to/contains/starts with the Specified Value " |
Strictly speaking, that is not the *business* requirement. It is somebody's interpretation of the business requirement.
Quote: |
If I comment out the XPATH Parsing , the message is Getting parsed in 60ms. |
With which parser? ( XMLNSC, I hope ).
Which version of WMB are you using?
Quote: |
I also thought of an Alternative approach ,as treating the Whole Message as String and using ESQL and implement the Logic using String Handling Functions. But this approach looks a bit weird. |
Please, no! It is one of the rules of XML processing that you cannot interpret XML using string functions. If you try, you are likely to waste a lot of time getting it right, and still end up with a fragile application.
If I were you, I would try to get a clearer set of requirements. You will probably find that the *actual* business requirements are a lot more specific than what you quoted. And once you know the real requirements, it might be a lot easier to hit the performance targets. |
|
Back to top |
|
 |
samgn123 |
Posted: Sun Dec 14, 2008 3:20 am Post subject: |
|
|
Newbie
Joined: 04 Nov 2008 Posts: 8
|
Thanks for the Response.
I agree that the Requirements are not that specific. But I clarified it several times and this is the Requirement. They are not specifying the Full path for the XML element/attribute and yet the performance is expected to be high.
The Version of Message Broker used is v6
And the XML Parser used is XMLNSC |
|
Back to top |
|
 |
kimbert |
Posted: Mon Dec 15, 2008 1:35 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
If I comment out the XPATH Parsing , the message is Getting parsed in 60ms. |
Please can you post the XPath parsing code. |
|
Back to top |
|
 |
samgn123 |
Posted: Tue Dec 16, 2008 3:11 am Post subject: |
|
|
Newbie
Joined: 04 Nov 2008 Posts: 8
|
I want to check whether the given ELement (fname) is present in the XML containing the SearchValue (ABC) . If any such element present containng the value , that will suffice my condition and I can stop searching further in the XML.
The XPath expression , I am using is
String xpathEvn = "boolean(//fname[contains( . ,'ABC')])";
This to check whether any ELement named "fname" contains a value equal to 'ABC' inside that. But I think this traverses the whole XML . That is even though it finds the Element containing the Value , it does not stop there and traverses furthere to find more such elements. |
|
Back to top |
|
 |
rekarm01 |
Posted: Thu Dec 18, 2008 9:18 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
samgn123 wrote: |
I am facing Performance Problems with respect to the XPATH Parsing. ...
The time taken to process the XML Message of around 600k is 5 to 6 sec, whereas the Performance Requirement is around 60ms.
But if I comment out the XPATH Parsing, the message is getting parsed in 60ms. |
If the requirement is around 60ms, and it already takes 60ms just to parse the message, then this leaves around zero ms for any XPATH query. Is that a realistic requirement?
samgn123 wrote: |
The XPath expression I am using is
Code: |
String xpathEvn = "boolean(//fname[contains(.,'ABC')])"; |
|
This expression might perform better:
Code: |
String xpathEvn = "boolean(/descendant::fname[contains(.,'ABC')][1])"; |
Although it still probably doesn't meet the 0 ms requirement.
Consult the XPATH documentation for a more detailed explanation as to how XPATH queries work. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|