camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raul Kripalani <r...@evosent.com>
Subject XmlConverter: thread safety of DBFs and TFs
Date Wed, 31 Jul 2013 22:01:05 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message