camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: How to control transactions when already in a transaction
Date Thu, 04 Jun 2009 17:04:14 GMT

What does your route look like?

Just a quick idea. Maybe in the producer template sendBody you could
use a JMS endpoint where you set transacted=false.

On Thu, Jun 4, 2009 at 6:43 PM, dcheckoway <> wrote:
> 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 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 (
> 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:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Apache Camel Committer

Open Source Integration:

View raw message