Hi

Can you show a bit more how you use the template and how you obtain
those endpoints.
And what kind of endpoints are those? Are you sending to a MQ or the likes?

Under the covers the Java DSL uses the same foundation as the template
so it ought to be able to run on par in speed.


On Wed, Jun 23, 2010 at 11:29 AM, NickWK <[email protected]> wrote:
>
> 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.
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to