camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Travis Klotz <>
Subject Re: Camel Transaction performance - use of batches?
Date Mon, 22 Aug 2011 16:12:12 GMT
I haven't worked with batches, but I did just spend a bunch of time
working with setting up Local JMS Transactions with ActiveMQ and
Camel.  The big things I found were:

* Make sure you turn the prefetch policy down to zero if you are
consuming messages across different machines.  You can do this with
your connection string, so something like:

* Make sure you are using a pooledConnectionFactory wrapped around the
normal AMQ connection factory  (and make sure the pooled connection
factory is stopped on shutdown)  So something like this if you are
using spring:

<bean id="pooledConnectionFactory"
  <property name="connectionFactory" ref="activemqConnectionFactory" />

* Set the cache level on the Jms/ActiveMQ Component properly.  I found
things worked best when set to CACHE_CONNECTION when working with
consumers on multiple servers and Master/Slave failover on the AMQ

<bean id="activemq"
  <property name="transacted" value="true"/>
  <property name="connectionFactory" ref="pooledConnectionFactory"/>
  <property name="transactionManager" ref="transactionManager"/>
  <property name="cacheLevelName" value="CACHE_CONNECTION"/>

Even with these settings, things are going to be quite a bit slower
than in a non-transactional setup.  A lot of that is just the penalty
for using transactions.  If performance is really critical you may
need to look at something like CLIENT_ACKNOWLEGE and deal with any
duplicate messages that may get passed through.


On Mon, Aug 22, 2011 at 7:08 AM, Viju <> wrote:
> Can someone please help or provide pointers ? The documentation indeed talks
> about batches  but cant see how is it feasible using camel batching?
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

View raw message