camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Transaction and Multicast() or to() AND to() ?
Date Tue, 19 May 2009 07:43:53 GMT
On Tue, May 19, 2009 at 9:11 AM, Charles Moulliard <cmoulliard@gmail.com> wrote:
> Hi,
>
> I would like to know if the transactional behavior of camel/spring will be
> the same comparing the two next routes :
>
> 1) Multicast
>
> from()
> transacted()
> multicast(
> to(bean:update DB)
> to(queue:IN)
> )
>
> 2) To() and to()
>
> from()
> transacted()
> to(bean:update DB)
> to(queue:IN)
>

Yes the TX is the same.


> Does it make sense to multicast messages when we want that data
> updated/inserted DB are rollbacked if an error occurs during creation of the
> message on the queue OR messages removed from the queue if an errors occurs
> during DB update ?

Spring TX manager will rollback the TX if it was marked for rollback
or it caughts a runtime exception.
So whatever you from the transacted() onwards will occur in the same TX.

Using either .to or .multicast has really nothing to do with TX.

The former is the Pipes And Filters EIP where output from the previous
is input to the next and so forth.
The latter is the Recipient List EIP where you send the *same* message
to multiple recipients.


>
> Regards,
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message