Hi guys,

I'm reviewing Camel's XML-related components for hotspots to improve
performance.

Looking at the XmlConverter class, I've spotted a possible thread safety
issue with the documentBuilderFactory and transformerFactory instance
fields. They are lazily initialized once and re-used forever (provided they
weren't explicitly set by the caller).

Can someone confirm my suspicions? I believe the JDK's default JAXP
implementation (Xerces) happens to be thread-safe, that's why it may have
gone unnoticed so far.

P.S.: I'm considering introducing an ArrayBlockingQueue to reuse DBFs,
TransformerFactories and DocumentBuilders.

Regards,

*Raúl Kripalani*
Apache Camel PMC Member & Committer | Enterprise Architect, Open Source
Integration specialist
http://about.me/raulkripalani | http://www.linkedin.com/in/raulkripalani
http://blog.raulkr.net | twitter: @raulvk

Reply via email to