in rest-cxf/src/main/java/org/apache/camel/example/springboot/cxf/CamelRouter.java [31:49]
public void configure() throws Exception {
//very raw way, just to handle the validation responses
onException(BeanValidationException.class)
.handled(true)
.setHeader(Exchange.HTTP_RESPONSE_CODE, constant(Response.Status.BAD_REQUEST.getStatusCode()))
.setBody(simple("${exchangeProperty.CamelExceptionCaught.getMessage()}"));
// @formatter:off
from("cxfrs:/api?" +
"resourceClasses=org.apache.camel.example.springboot.cxf.UserService" +
"&bindingStyle=SimpleConsumer" +
"&providers=jaxrsProvider" +
"&loggingFeatureEnabled=true")
.to("bean-validator:user")
.to("log:camel-cxf-log?showAll=true")
.setHeader(Exchange.BEAN_METHOD_NAME, simple("${header.operationName}"))
.bean(UserServiceImpl.class);
// @formatter:on
}