Hi, When you using sendTo expression, the exchange will be processed, so the original exchange will be processed. If you need to use the original message body again, you need to resort it yourself.
-- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, June 27, 2013 at 9:20 AM, David MacDonald wrote: > Hi all, > > I'm attempting to use a sub-route via the sendTo expression to act as a > filter (this involves a callout to a web-service), however I run into a > problem in that the sendTo callout overwrites the original exchange body. > For example, > ... > .choice() > .when(sendTo("direct:someFilterService").isEqualTo("false")) > .log("the body is now false, rather than the original body") > .otherwise() > .log("the body is now true, rather than the original body'") > .end() > > I've worked around this by using .setProperty("OriginalBody",body()) and > replacing it after the filtering however this isn't terribly elegant. I also > realize that it's possible to use a Processor and some kind of producer > template but I'd like to avoid adding Java code. > > So, is it possible for the sendTo expression to return a new exchange purely > for evaluation? > > Thanks, > David > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Choice-sendTo-and-overwriting-exchange-body-tp5734867.html > Sent from the Camel - Users mailing list archive at Nabble.com > (http://Nabble.com).