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.