private class MyValidatorProcessor implements Processor {
public void process(Exchange exchange) throws Exception {
String body = exchange.getIn().getBody(String.class);
if ("London".equals(body)) {
throw new ValidationException(exchange, "Forced exception by unit test");
} else if ("Madrid".equals(body)) {
throw new RuntimeCamelException("Madrid is not a supported city");
} else if ("Dublin".equals(body)) {
throw new ValidationException(exchange, "Dublin have good beer");
}
exchange.getOut().setBody("Hello " + body);
}