You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Fladnag <fl...@zerezo.com> on 2013/04/18 15:26:14 UTC
Exchange.isTransacted, splitter and direct
Hi,
The fuse documentation said that we can break a transacted route into
fragment with direct component :
http://fusesource.com/docs/router/2.8/transactions/TxnDemarcation-ByMarking.html#TxnDemarcation-ByMarking-BreakingARoute
but the Exchange.isTransacted() method does not return the same result in my
splitter route, with or without use of direct endpoint.
Test environment :
Camel : 2.8.5 & 2.10.4
ServiceMix : 4.4.2 & 4.5.1
in & out are ActiveMQ endpoints.
The results for the "a z e" message are :
With transacted :
215 - before direct : Transacted ? true / UOW :
ID-FR-COMPUTER-58762-1366289697312-1-2@17560578 / BODY = a z e
215 - before split : Transacted ? true / UOW :
ID-FR-COMPUTER-58762-1366289697312-1-2@17560578 / BODY = a z e
215 - after split : Transacted ? *false */ UOW :
ID-FR-COMPUTER-58762-1366289697312-1-4@3298616 / BODY = a
215 - after split : Transacted ? *false */ UOW :
ID-FR-COMPUTER-58762-1366289697312-1-6@10460150 / BODY = z
Without direct :
289 - before split : Transacted ? true / UOW :
ID-FR-COMPUTER-58762-1366289697312-3-2@7891568 / BODY = a z e
289 - after split : Transacted ? *true */ UOW :
ID-FR-COMPUTER-58762-1366289697312-3-4@14592580 / BODY = a
289 - after split : Transacted ? *true */ UOW :
ID-FR-COMPUTER-58762-1366289697312-3-6@11155716 / BODY = z
With two transacted :
304 - before direct : Transacted ? true / UOW :
ID-FR-COMPUTER-58762-1366289697312-4-2@7830155 / BODY = a z e
304 - before split : Transacted ? true / UOW :
ID-FR-COMPUTER-58762-1366289697312-4-2@7830155 / BODY = a z e
304 - after split : Transacted ? *true */ UOW :
ID-FR-COMPUTER-58762-1366289697312-4-4@5193228 / BODY = a
304 - after split : Transacted ? *true */ UOW :
ID-FR-COMPUTER-58762-1366289697312-4-6@31093268 / BODY = z
The behavior of commit / rollback seems correct in each case, but I can't
call isTransacted() in the first case.
Can I use the 3rd example without issue ? With 2 calls of transacted() ?
--
View this message in context: http://camel.465427.n5.nabble.com/Exchange-isTransacted-splitter-and-direct-tp5731076.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Exchange.isTransacted, splitter and direct
Posted by Fladnag <fl...@zerezo.com>.
Claus Ibsen-2 wrote
> The question is whether we should preserve the transaction flag for
> splitted exchanges?
Yes, it's seem logic that isTransacted() return true when
parallelProcessing=false but it's not the case
Not a real issue if isTransacted is just a hint and not used in internal
camel code; we just can't trust this method for our code ;o)
--
View this message in context: http://camel.465427.n5.nabble.com/Exchange-isTransacted-splitter-and-direct-tp5731076p5731600.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Exchange.isTransacted, splitter and direct
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Yeah the isTransacted is just a hint.
The TX manager is orchestrating the transaction. And as long you
process the messages using the same thread then that works.
So for the splitter you would need to NOT run it in parallel.
The splitter is splitting the original exchange and creates new
exchanges, one for each splitted message. And so their transacted flag
is false.
The question is whether we should preserve the transaction flag for
splitted exchanges?
On Thu, Apr 18, 2013 at 3:26 PM, Fladnag <fl...@zerezo.com> wrote:
> Hi,
>
> The fuse documentation said that we can break a transacted route into
> fragment with direct component :
> http://fusesource.com/docs/router/2.8/transactions/TxnDemarcation-ByMarking.html#TxnDemarcation-ByMarking-BreakingARoute
> but the Exchange.isTransacted() method does not return the same result in my
> splitter route, with or without use of direct endpoint.
>
> Test environment :
> Camel : 2.8.5 & 2.10.4
> ServiceMix : 4.4.2 & 4.5.1
>
> in & out are ActiveMQ endpoints.
>
>
>
> The results for the "a z e" message are :
> With transacted :
> 215 - before direct : Transacted ? true / UOW :
> ID-FR-COMPUTER-58762-1366289697312-1-2@17560578 / BODY = a z e
> 215 - before split : Transacted ? true / UOW :
> ID-FR-COMPUTER-58762-1366289697312-1-2@17560578 / BODY = a z e
> 215 - after split : Transacted ? *false */ UOW :
> ID-FR-COMPUTER-58762-1366289697312-1-4@3298616 / BODY = a
> 215 - after split : Transacted ? *false */ UOW :
> ID-FR-COMPUTER-58762-1366289697312-1-6@10460150 / BODY = z
>
> Without direct :
> 289 - before split : Transacted ? true / UOW :
> ID-FR-COMPUTER-58762-1366289697312-3-2@7891568 / BODY = a z e
> 289 - after split : Transacted ? *true */ UOW :
> ID-FR-COMPUTER-58762-1366289697312-3-4@14592580 / BODY = a
> 289 - after split : Transacted ? *true */ UOW :
> ID-FR-COMPUTER-58762-1366289697312-3-6@11155716 / BODY = z
>
> With two transacted :
> 304 - before direct : Transacted ? true / UOW :
> ID-FR-COMPUTER-58762-1366289697312-4-2@7830155 / BODY = a z e
> 304 - before split : Transacted ? true / UOW :
> ID-FR-COMPUTER-58762-1366289697312-4-2@7830155 / BODY = a z e
> 304 - after split : Transacted ? *true */ UOW :
> ID-FR-COMPUTER-58762-1366289697312-4-4@5193228 / BODY = a
> 304 - after split : Transacted ? *true */ UOW :
> ID-FR-COMPUTER-58762-1366289697312-4-6@31093268 / BODY = z
>
> The behavior of commit / rollback seems correct in each case, but I can't
> call isTransacted() in the first case.
>
> Can I use the 3rd example without issue ? With 2 calls of transacted() ?
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Exchange-isTransacted-splitter-and-direct-tp5731076.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen