Reputation: 1
I have a flow that receives an XML request. I then call a jdbc outbound endpoint performing a query against an Oracle database. The result of the query is then transformed to XML using an xquery transformer and sent back. The sql from the database returns at most 50 000 rows, but the XML file created by the xquery transformer has 60 lines per row resulting in a very large XML file (15-100 MB). Mule is taking a very long time "mapping/creating" the XML file and I am wondering if I can speed up the process somehow or if I have to rethink my approach.
Regards,
Magnus
Upvotes: 0
Views: 421
Reputation: 524
Directly from Mule's documentation:
Efficient Transformations with DelayedResult
Mule contains a special XML output format called DelayedResult. This format allows very efficient XML transformations by delaying any XML serialization until an OutputStream is available.
For example, here is an XSLT transformer set up to use DelayedResult:
<mxml:xslt-transformer name="transform-in"
xsl-file="xslt/transform.xslt"
returnClass="org.mule.module.xml.transformer.DelayedResult"/>
If the result of this transformation were being sent to an HTTP client, the HTTP client would ask Mule for an OutputHandler and pass in the OutputStream to it. Only then would Mule perform the transformation, writing the output directly to the OutputStream.
If DelayedResult were not used, the XML result would first be written to an in-memory buffer before being written to the OutputStream. This will cause your XML processing to be slower.
So it makes more sense to use the XSLT transformer instead of the XQuery one.
Upvotes: 0
Reputation: 2176
Zorba provides a JDBC connector and streaming capabilities: http://www.zorba-xquery.com/ It might be just what you are looking for.
Upvotes: 0