You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@servicemix.apache.org by "Jonathan Anstey (JIRA)" <ji...@apache.org> on 2011/04/19 14:24:05 UTC

[jira] [Updated] (SM-2069) SourceTransformer should cache DocumentBuilder & TransformerFactory

     [ https://issues.apache.org/jira/browse/SM-2069?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Anstey updated SM-2069:
--------------------------------

    Attachment: cache_docbuilder.patch

> SourceTransformer should cache DocumentBuilder & TransformerFactory
> -------------------------------------------------------------------
>
>                 Key: SM-2069
>                 URL: https://issues.apache.org/jira/browse/SM-2069
>             Project: ServiceMix
>          Issue Type: Improvement
>    Affects Versions: servicemix-utils-1.5.0
>         Environment: http://svn.apache.org/repos/asf/servicemix/utils/trunk
>            Reporter: Jonathan Anstey
>         Attachments: cache_docbuilder.patch, cache_docbuilder_test.patch
>
>
> I noticed that when routing between JBI endpoints in Camel like:
> {code}
> from("jbi:endpoint:serviceNamespace:serviceA:endpointA").to("jbi:endpoint:serviceNamespace:serviceB:endpointB");
> {code}
> There is a huge overhead creating new TransformerFactory and DocumentBuilder objects. After caching these on a per thread basis I was able to get a test case down from 41.583 sec to 18.224 sec.
> To test this, apply the attached patch (cache_docbuilder.patch) to the servicemix-utils trunk, and also modify the servicemix-camel component with the attached patch (cache_docbuilder_test.patch) and run the following:
> janstey@duffman:/x1/asf/servicemix/components/trunk/engines/servicemix-camel$ mvn clean test -Dtest=SendFromCamelToJbiThenRouteToAnotherJbiComponentTest
> You may need to up surefire's Xmx as well.
> If someone is going to commit this, please only commit the code in cache_docbuilder.patch

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira