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.