Hi First about using IN vs OUT see this FAQ http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html
you should really just only use IN On Fri, May 30, 2014 at 9:49 PM, Max Bridgewater <[email protected]> wrote: > Now, this one is really puzzling me. What is the difference between the > following two routes? I thought they would produce the same thing. > > Right now, route1 produces "hoho" while the route2 produces "haha". > > > <route id="route1"> > <from uri="restlet:/route1"/> > <onCompletion onCompleteOnly="true"> > <transform> > <groovy>exchange.getIn().setBody("haha"); > exchange.getOut().setBody("haha"); "haha"</groovy> > </transform> > </onCompletion> > <transform> > <constant>hoho</constant> > </transform> > </route> > > <route id="route2"> > <from uri="restlet:/route2"/> > <transform> > <groovy> > exchange.getUnitOfWork().addSynchronization( > new org.apache.camel.spi.Synchronization(){ > public void > onComplete(org.apache.camel.Exchange x){ > x.getOut().setBody("haha"); > } > public void onFailure(org.apache.camel.Exchange > exchange){} > } > ) > </groovy> > </transform> > <transform> > <constant>hoho</constant> > </transform> > </route> > > > > > > Max. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
