camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinicius Carvalho <java.vinic...@gmail.com>
Subject JMS component + Transactions
Date Mon, 25 Jul 2011 11:20:18 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message