You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Vinicius Carvalho <ja...@gmail.com> on 2011/07/25 13:20:18 UTC

JMS component + Transactions

Hi there! I'm trying to integrate camel with CDI and HornetQ. I've checked
the great camel-pe project, but since I needed something different, I'm
implementing everything again, so far things are going good. Now, I needed
to integrate the transactions support. Here's some snippet of my code:


context.addComponent("jms",
JmsComponent.jmsComponentTransacted(((CDICamelContext)context).getConnectionFactory()));

The connectionFactory being used is a JmsXA connection factory from JNDI of
HornetQ.

After using this component I'm getting loads (I believe every second) of
messages at the log:

12:18:10,460 INFO  [stdout] (AsyncAppender-Dispatcher-Thread-18) [25/07/11
12:18:10:010 IST] DEBUG connection.JmsTransactionManager: Creating new
transaction with name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT

12:18:10,460 INFO  [stdout] (AsyncAppender-Dispatcher-Thread-18) [25/07/11
12:18:10:010 IST] DEBUG connection.JmsTransactionManager: Created JMS
transaction on Session [org.hornetq.ra.HornetQRASession@10e39e6] from
Connection [org.hornetq.ra.HornetQRASessionFactoryImpl@fb4226]

12:18:11,460 INFO  [stdout] (AsyncAppender-Dispatcher-Thread-18) [25/07/11
12:18:11:011 IST] DEBUG connection.JmsTransactionManager: Initiating
transaction commit

12:18:11,461 INFO  [stdout] (AsyncAppender-Dispatcher-Thread-18) [25/07/11
12:18:11:011 IST] DEBUG connection.JmsTransactionManager: Committing JMS
transaction on Session [org.hornetq.ra.HornetQRASession@10e39e6]


And everytime a new connection. I know I should configure the JMS
connectionfactory to be a pooled one, but even before that, why protected
void doBegin(Object transaction, TransactionDefinition definition)  gets
called so many times? Is this a normal behavior? I'm a bit concerned about
performance here.

Regards.

PS: By the way, is auto_ack the default option for JMS on camel? I also
would like to get the message redelivered in case of something goes wrong on
my consumer.

Regards