You are returning the original exchange. That's why it appears as if nothing happened in the enrichment.
The idea behind enriching is that you alter the original exchange with some values from the "call out" exchange, e.g. adding properties or headers, augmenting the body with more data, etc. There are examples available on the website. The exception is likely not triggered because 'i' is an unused variable, so the JVM doesn't even bother executing the assignment as an effect of optimisation. Regards, Raúl. On 6 Mar 2013 06:50, "Jean Francois LE BESCONT" <jflebesc...@gmail.com> wrote: > If i do: > public class AggregationStrategyRessource implements AggregationStrategy { > > @Override > public Exchange aggregate(Exchange original, Exchange resource) { > int i = 1 / 0; > return original; > } > } > > no exception are thows. > > > > 2013/3/6 Jean Francois LE BESCONT <jflebesc...@gmail.com> > > > thks Raul > > > > For the moment it's a simple : > > > > public class AggregationStrategyRessource implements AggregationStrategy > { > > > > @Override > > public Exchange aggregate(Exchange original, Exchange resource) { > > return original; > > } > > > > } > > > > If I put a debug point on it, it is never fired .... > > > > > > > > > > > > 2013/3/6 Raúl Kripalani <r...@evosent.com> > > > >> Can we see the code of AggregationStrategyRessource? > >> > >> Regards, > >> Raúl. > >> > >> On Mar 5, 2013, at 23:30, Jean Francois LE BESCONT wrote: > >> > >> > Hey, > >> > > >> > I have this > > >> > > >> > http://camel.465427.n5.nabble.com/Enrich-message-with-data-from-dynamic-sql-query-td5329427.html > >> > > >> > But I haven't found a solution to my question. > >> > > >> > How can enrich my stream with data from a queries ? > >> > > >> > I have a a route called from the start : > >> > > >> > from("direct:refreshReferentielDynamic") > >> > // > >> > .setBody(constant("SELECT * FROM TEST")) > >> > // > >> > .to("jdbc:dataSource") > >> > // > >> > .to("direct:ds") > >> > // > >> > .end(); > >> > > >> > > >> > End I would like to acces data in memory in direct:ds from an other > >> route. > >> > I have try this : > >> > > >> > from("foo"). > >> > [...] > >> > .enrich("direct:ds", new AggregationStrategyRessource()) > >> > > >> > But code in AggregationStrategyRessource is not called ... and body is > >> > replace by the content of the query. > >> > > >> > Thks ! > >> > > >> > Thks ! > >> > >> > > >