camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <>
Subject Re: Context Component and Transactions...
Date Fri, 20 Apr 2012 20:13:32 GMT
It depends... ;-)

Camel relays on SpringPlatformTransactionManager which is bound to the
current thread,
If you use the "direct" protocol/component, this will be part of this
transaction. If you use the "seda" or "vm" protocol/component (which will
use a different thread), the route in your context component will not be
part of this transaction.

from("vm:in").transacted().to(...).to("vm:out"); make no sense, because the
"vm" component doesn't support transactions, unless your to(...) talks to a
transacted resource.


On Fri, Apr 20, 2012 at 2:38 PM, James Carman <>wrote:

> We are planning to write a bunch of camel contexts which contain
> routes using only local endpoints (the vm component).  To get everyone
> talking to one another, we'll create a "wiring" context which connects
> the dots.  I was wondering how this will work with transactions.
> Suppose I have a few routes like this...
> In "wiring" context:
> from("jms:queue:inputQueue").transacted().to("context:a:in");
> from("context:a:out").transacted().to("jms:queue:outputQueue");
> In context "a":
> from("vm:in").transacted().to(...).to("vm:out");
> I assume the transaction won't span through the route in context "a",
> correct?  What happens here?  Let's say there's some failure in the
> "..." part of my route with a database or something.  The original
> message won't go back onto the "inputQueue" will it?  My understanding
> is that the transacted() part will start a transaction once the route
> begins and try to commit it when the route ends.

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