Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
servicemix-utils-1.5.0
-
None
-
Patch Available
Description
I noticed that when routing between JBI endpoints in Camel like:
from("jbi:endpoint:serviceNamespace:serviceA:endpointA").to("jbi:endpoint:serviceNamespace:serviceB:endpointB");
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