Just set a header with the key Exchange.HTTP_RESPONSE_CODE and the integer for the code you want to use. Then Camel will use that.
On Mon, May 13, 2013 at 6:53 PM, kalyan <register.kal...@gmail.com> wrote: > I have a simple RouteBuilder as follows: > > RouteBuilder routeBuilder = new RouteBuilder() > { > @Override > public void configure() > { > onException(HttpOperationFailedException.class).handled(true) > .process(new Processor() > { > @Override > public void process(Exchange exchange) > throws Exception > { > //Expecting that there is an exception this code is reached. > LOGGER.warn("############### msg:" + > exchange.getProperty(Exchange.EXCEPTION_CAUGHT, > HttpOperationFailedException.class).getMessage()); > } > }).transform().constant("There was an exception"); > > from("servlet:///test?matchOnUriPrefix=true") > .to("http://localhost:8080/mywar/sample?bridgeEndpoint=true"); > } > }; > > when I have handled(true), it changes the response status to 200. However, I > would like to update only the body information (to "There was an exception") > when there is an exception without changing other values. > > Is this possible ? > > Regards, > Kalyan > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-do-I-change-message-body-without-changing-response-status-tp5732419.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- www.camelone.org: The open source integration conference. Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen