首页 文章

MULE:Xquery变压器性能问题

提问于
浏览
0

我有一个接收XML请求的流程 . 然后,我调用一个jdbc出站 endpoints ,对Oracle数据库执行查询 . 然后使用xquery转换器将查询结果转换为XML并发回 . 来自数据库的sql最多返回50 000行,但xquery转换器创建的XML文件每行有60行,从而产生一个非常大的XML文件(15-100 MB) . Mule花了很长时间“映射/创建”XML文件,我想知道我是否可以某种方式加快这个过程,或者我是否需要重新考虑我的方法 .

问候,

马格努斯

2 回答

  • 0

    直接来自Mule的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.
    

    因此,使用XSLT转换器而不是XQuery转换器更有意义 .

  • 0

    Zorba提供了JDBC连接器和流媒体功能:http://www.zorba-xquery.com/它可能正是您所寻找的 .

相关问题