You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by jmh <je...@nrb.be> on 2011/12/30 16:25:31 UTC

can the aggregationRepository join a JMS transaction ?

Hello,


I don't want to lose any message if my application crashes during an
aggregation so I add an aggregationRepository in my JMS transaction...
Can the aggregationRepositoryRef join the JMS transaction in this following
route ?

from("activemq:file2doc.prepareReturnFile")				
				.aggregate(header(GedConstants.SET_NAME),
						fileAggregationStrategy)
				.aggregationRepositoryRef("gedLineRepo")
				.completionSize(header("returnFileCount"))				
				.beanRef(BEAN_REF_FILE2DOC_CAMEL_FACADE, "mergeInfo")			
.to("activemq:file2doc.return");

Thanks for any suggestion


--
View this message in context: http://camel.465427.n5.nabble.com/can-the-aggregationRepository-join-a-JMS-transaction-tp5110230p5110230.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: can the aggregationRepository join a JMS transaction ?

Posted by jmh <je...@nrb.be>.
Thanks Claus !

I have already bought your book but I need to read the chapter #9 more in
depth ;-)

Best wishes to you and Camel !

--
View this message in context: http://camel.465427.n5.nabble.com/can-the-aggregationRepository-join-a-JMS-transaction-tp5110230p5113123.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: can the aggregationRepository join a JMS transaction ?

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Dec 30, 2011 at 4:25 PM, jmh <je...@nrb.be> wrote:
> Hello,
>
>
> I don't want to lose any message if my application crashes during an
> aggregation so I add an aggregationRepository in my JMS transaction...
> Can the aggregationRepositoryRef join the JMS transaction in this following
> route ?

Yes, the JMS transaction will only commit if the exchange could be
successfully processed (eg no exceptions is thrown).
So if the code that stores the exchange in the aggregation repository
do not throw an exception, then the TX is okay.

However as said before, the outgoing messages from the aggregator, do
*not* participate in the JMS transaction (eg from the input side).

The Camel in Action book covers in depth this use-case.


>
> from("activemq:file2doc.prepareReturnFile")
>                                .aggregate(header(GedConstants.SET_NAME),
>                                                fileAggregationStrategy)
>                                .aggregationRepositoryRef("gedLineRepo")
>                                .completionSize(header("returnFileCount"))
>                                .beanRef(BEAN_REF_FILE2DOC_CAMEL_FACADE, "mergeInfo")
> .to("activemq:file2doc.return");
>
> Thanks for any suggestion
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/can-the-aggregationRepository-join-a-JMS-transaction-tp5110230p5110230.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/