This makes sense - so with <transacted/> the scope is the route - not
the endpoint.
Which makes sense for my usecase (which I initially started out with
in my mail) - where the last endpoint in my route is a jms one - and
the first one an jms one - so in this case I should use transacted to
ensure that both endpoints are covered by the same tx.

2012/11/7 Claus Ibsen <[email protected]>:
> On Mon, Nov 5, 2012 at 7:36 PM, David J. M. Karlsen
> <[email protected]> wrote:
>> Hi.
>>
>> I have a route where the from endpoint is jms based.
>> The end of the route will be a jms endpoint as well.
>> I also have errorhandling in an onException clause which will put the
>> message on a third jms queue.
>>
>> So in short - jms in - jms out.
>>
>> I wanna protect this messagehandling with a jms transaction handler (all
>> resources use the same connection factory so that messages cannot be lost.
>>
>> I can either configure the route to use <transacted /> as described in:
>> http://camel.apache.org/transactional-client.html.
>>
>> But I can also just configure the jms endpoints to use transacted=true as
>> described in:
>> http://camel.apache.org/jms.html
>>
>> is there any difference at all by configuring them either way?
>>
>
> Scott and you are both right. Scott highlight the fact that
> <transacted> ensures the Camel processing runs inside a TX context.
> Where as without that the TX context is only for the broker (and only
> within the same unit of work from the same JMS session).
>
> So if you only use JMS (from the same broker), then in essence you may
> not need to have <transacted> in the route.
> And only if your route starts from JMS.
>
> If you do
>
> from jetty:http
>    to jms
>    to file
>
> And want the JMS to be transacted, then you would need to use
> <transacted> to ensure the route is acting in the same TX context. eg
> to only commit sending the message to the JMS endpoint, if the route
> completed successful.
>
> And therefore you would need to enable TX on the route:
>
> from jetty:http
>    transacted
>    to jms
>    to file
>
>
> Does my rambling make any sense?
>
>
>
>
>
>
>>
>>
>> --
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/transactional-client-vs-transacted-true-on-a-jms-route-tp5722167.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: [email protected]
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
--
David J. M. Karlsen - http://www.linkedin.com/in/davidkarlsen

Reply via email to