Hi retryWhile is only for returning true|false, not for modifying. You should use onRedelivery to do any custom modifications before a redelivery attempt.
On Sun, Jan 26, 2014 at 7:40 PM, Elvio Caruana (ecaruana) <[email protected]> wrote: > Hi all, > > I've got a scenario where given an exception on a route, I want to retry the > sub-route but with a modified body (String.class type). > from("direct:foo") > .onException(SomeException.class) > .handled(true) > .retryWhile(new Predicate() { > @Override > public boolean matches(Exchange exchange) { > if (canContinue()) { > exchange.getIn().setBody("newly modified > string"); > return true; > } > else { > return false; > } > > } > }).end() > .to("direct:bar"); > > The retries are being done correctly and exhausted at the right time - > however every retry always has the original body, and not the modified string > body I was expecting. Am I not able to modify the exchange body on retry? > > Many Thanks, > Elvio > -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen Make your Camel applications look hawt, try: http://hawt.io
