[
https://issues.apache.org/jira/browse/CAMEL-3776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13243691#comment-13243691
]
Christian Müller commented on CAMEL-3776:
-----------------------------------------
Frank, I tried whether Camel can deal with the XMLStreamReader conversion out
of the box (without your patch). So, there is nothing wrong with it.
I made a couple of stress tests. I unmarshaled the XML
{code:xml}
<purchaseOrder name='Wine' amount='123.45' price='2.22'/>
{code}
10000 times with
{code:java}
ExecutorService pool = Executors.newFixedThreadPool(20);
long start = System.currentTimeMillis();
for (int i = 0; i < counter; i++) {
pool.execute(new Runnable() {
public void run() {
template.sendBody(payload);
latch.countDown();
}
});
}
{code}
The numbers I got for different scenarios are:
- with the current implementation it took 6440ms
- with using a GenericObjectPool from commons-pool (maxActive = 20) it took
3323ms
- with using a ReentrantLock in JaxbDataFormat.unmarshal() for the lines where
the Unmarshaller is used, it took 2813ms
I didn't had the time to look what's necessary to get the
convertBodyTo(XMLStreamReader.class) working an what the performance is.
May be the ReentrantLock is a smart solution without the "complexity" of
pooling objects?
> Add pooling support for JAXB data format
> ----------------------------------------
>
> Key: CAMEL-3776
> URL: https://issues.apache.org/jira/browse/CAMEL-3776
> Project: Camel
> Issue Type: New Feature
> Components: camel-jaxb
> Reporter: Claus Ibsen
> Fix For: 3.0.0
>
> Attachments: jaxb-pool.patch
>
>
> We should use the ServicePool in camel-core to pool JAXB / marshaller /
> unmarshaller.
> Of course ppl should be able to customize pool settings and if to be used.
> Also mind that for type converters with JAXB you do not configure a JAXB data
> format. And thus we should
> still be able to configure and use pooling, so the type converter can be more
> efficient.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira