camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcheckoway <dchecko...@gmail.com>
Subject How to control transactions when already in a transaction
Date Thu, 04 Jun 2009 16:43:50 GMT

Camel 1.6.1, ActiveMQ 5.2.0, Spring 2.5.6

I have a POJO consumer that gets invoked by Camel for messages on an
ActiveMQ JMS queue.  It's set up as transacted (JMS transaction manager). 
While my POJO is consuming a message, it needs to send a subsequent message
(or several messages) to a different JMS queue.  I use
ProducerTemplate.sendBody to accomplish this...it works fine...except...

My "complaint" is that the messages my consumer ends up sending don't
actually "appear" (in their respective JMS queue) until my consumer returns
(commits?).

Based on what I've read here (
http://activemq.apache.org/how-do-transactions-work.html ActiveMQ: How do
transactions work ) I'm convinced that ActiveMQ is buffering up the sent
messages until the consumer commits its transaction.  Something like that --
I'm definitely not an expert on transactions...and that's why I'm posting
this.

Is there any way to force an already-in-transaction consumer to use a
*separate* transaction when calling ProducerTemplate.sendBody?

Is there another trick?

My goal is to avoid the whole buffer-til-commit thing if possible, and just
have those sent messages queued "immediately."

Thanks in advance...
-- 
View this message in context: http://www.nabble.com/How-to-control-transactions-when-already-in-a-transaction-tp23873683p23873683.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message