You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by cmoulliard <cm...@gmail.com> on 2008/07/07 14:19:34 UTC
Is it possible to send a message towards 2 endpoints but the
message is unmarshalled for one of the two destinations ?
Hi,
Is it possible to send a message towards 2 endpoints (in //) but the message
is unmarshalled for one of the two destinations (and not for the other) and
if an error occurs everything is rollbacked ?
Idea:
From("file:c:///temp")
.parrallel(
.to("bean:saveContent".unmarshall(jaxb))
.to("activemq:queue.myqueue"));
Regards,
Charles
--
View this message in context: http://www.nabble.com/Is-it-possible-to-send-a-message-towards-2-endpoints-but-the-message-is-unmarshalled-for-one-of-the-two-destinations---tp18315419s22882p18315419.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Is it possible to send a message towards 2 endpoints but the
message is unmarshalled for one of the two destinations ?
Posted by cmoulliard <cm...@gmail.com>.
To be clear with what I understand by work in //, here is an explanation :
from("file://temp").
The content of the file is send to A) and B) at the same time
(A) The bean will save the content and next we call unmarshal to transform
the XML into Java objects
.to("bean:saveContent").unmarshall().jaxb()
(B) The content of the file will be placed in the queue.
.to("activemq:myqueue")
Concerning the transactional aspect, iIf something goes wrong during the
processing of
- (A) e.g. data could not be saved in the DB and/or JAXB generates an error
- OR (B) e.g. Message could not be save in the queue
rollback should occur in process (A) and/or (B) and the file not deleted by
example
Regards
Charles
James.Strachan wrote:
>
> 2008/7/15 cmoulliard <cm...@gmail.com>:
>>
>> Even if we achieve the same result, what you propose is not really //
>> because
>> 1st we call the bean to save the content and next we unmarshall it before
>> to
>> commit it in the queue.
>
> Sorry you lost me there :). With transactions it doesn't much matter
> the steps in the flow; all that matters is that the entire route is
> atomic; all steps work or they all rollback.
>
>
>> Is there a wiki page describing which resources are transactional in
>> Camel ?
>
> Currently the transactional resources are JPA, Hibernate, JMS and JDBC
> - using Spring's declarative transactions
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>
>
-----
Enterprise Architect
Xpectis
12, route d'Esch
L-1470 Luxembourg
Phone +352 25 10 70 470
Mobile +352 621 45 36 22
e-mail : cmoulliard@xpectis.com
web site : www.xpectis.com
--
View this message in context: http://www.nabble.com/Is-it-possible-to-send-a-message-towards-2-endpoints-but-the-message-is-unmarshalled-for-one-of-the-two-destinations---tp18315419s22882p18484070.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Is it possible to send a message towards 2 endpoints but the message is unmarshalled for one of the two destinations ?
Posted by James Strachan <ja...@gmail.com>.
2008/7/15 cmoulliard <cm...@gmail.com>:
>
> Even if we achieve the same result, what you propose is not really // because
> 1st we call the bean to save the content and next we unmarshall it before to
> commit it in the queue.
Sorry you lost me there :). With transactions it doesn't much matter
the steps in the flow; all that matters is that the entire route is
atomic; all steps work or they all rollback.
> Is there a wiki page describing which resources are transactional in Camel ?
Currently the transactional resources are JPA, Hibernate, JMS and JDBC
- using Spring's declarative transactions
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com
Re: Is it possible to send a message towards 2 endpoints but the
message is unmarshalled for one of the two destinations ?
Posted by cmoulliard <cm...@gmail.com>.
Even if we achieve the same result, what you propose is not really // because
1st we call the bean to save the content and next we unmarshall it before to
commit it in the queue.
Is there a wiki page describing which resources are transactional in Camel ?
Regards,
Charles
James.Strachan wrote:
>
> 2008/7/7 cmoulliard <cm...@gmail.com>:
>>
>> Hi,
>>
>> Is it possible to send a message towards 2 endpoints (in //) but the
>> message
>> is unmarshalled for one of the two destinations (and not for the other)
>> and
>> if an error occurs everything is rollbacked ?
>>
>> Idea:
>>
>> From("file:c:///temp")
>> .parrallel(
>> .to("bean:saveContent".unmarshall(jaxb))
>> .to("activemq:queue.myqueue"));
>
> This should do what you want...
>
> from("file://temp").
> beanRef("saveContent").
> unmarshall().jaxb().
> to("activemq:myqueue")
>
> though the rollback only applies to transactional resources - which in
> the above route is only the activemq endpoint.
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>
> Open Source Integration
> http://open.iona.com
>
>
-----
Enterprise Architect
Xpectis
12, route d'Esch
L-1470 Luxembourg
Phone +352 25 10 70 470
Mobile +352 621 45 36 22
e-mail : cmoulliard@xpectis.com
web site : www.xpectis.com
--
View this message in context: http://www.nabble.com/Is-it-possible-to-send-a-message-towards-2-endpoints-but-the-message-is-unmarshalled-for-one-of-the-two-destinations---tp18315419s22882p18468348.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Is it possible to send a message towards 2 endpoints but the message is unmarshalled for one of the two destinations ?
Posted by James Strachan <ja...@gmail.com>.
2008/7/7 cmoulliard <cm...@gmail.com>:
>
> Hi,
>
> Is it possible to send a message towards 2 endpoints (in //) but the message
> is unmarshalled for one of the two destinations (and not for the other) and
> if an error occurs everything is rollbacked ?
>
> Idea:
>
> From("file:c:///temp")
> .parrallel(
> .to("bean:saveContent".unmarshall(jaxb))
> .to("activemq:queue.myqueue"));
This should do what you want...
from("file://temp").
beanRef("saveContent").
unmarshall().jaxb().
to("activemq:myqueue")
though the rollback only applies to transactional resources - which in
the above route is only the activemq endpoint.
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com