I am using Apache Camel version 2.2.0-fuse-01-00 in the WebSphere Application
Server web container.
I am looking to use the Apache Camel ProducerTemplate class to send messages
to endpoints from within a Java class and have observed a significant
reduction in message throughput when using the
ProducerTemplate.send(Endpoint, Exchange) method over sending message to
endpoints directly in Java DSL. With a pure Java DSL solution I was
observing a throughput of 23 msgs/s and when writing to same Camel endpoints
from a JavaBean using a ProducerTemplate throughput fell to 4 msgs/s.
I have declared my ProducerTemplate as a bean in the Spring configuration
file as suggested in the documentation:
<camel-spring:template id="template"/>
In the JavaBean I lookup the template from Spring ApplicationContext ctx:
ProducerTemplate localProducer = (ProducerTemplate)ctx.getBean("template");
And write to a Camel endpoint using:
localProducer.send(endpoint, exchange);
With Spring handling the lifecycle of the ProducerTemplate.
Is this the correct way to use a ProducerTemplate?
Has anybody else experienced a performance hit when using the
ProducerTemplate?
Is their any alternative method available for writing to a camel producer
from a POJO?
--
View this message in context:
http://camel.465427.n5.nabble.com/Performance-loss-observed-when-using-the-ProducerTemplate-to-send-an-exchange-to-an-endpoint-tp510843p510843.html
Sent from the Camel - Users mailing list archive at Nabble.com.