Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
public void initRoute() throws java.lang.Exception {
routeBuilder = new org.apache.camel.builder.RouteBuilder() {
public void configure() throws java.lang.Exception {
from(uriMap.get("input_queue"))
.routeId("input_queue")
.setHeader("AuditStep")
.constant("XSD Validation")
.id("cSetHeader_1")
.id("cTry_1")
.doTry()
.setHeader("AuditStep")
.constant("REST Consolider")
.id("cSetHeader_2")
.setHeader("CamelHttpMethod", constant("POST"))
.setHeader("Content-Type",
constant("application/xml"))
.to(uriMap.get("REST Consolider"))
.id("cHttp_2")
.log(org.apache.camel.LoggingLevel.INFO,
"cLog_1", "REST Response : ${body}")
.id("cLog_1")
.to(uriMap.get("to_target_JMS"))
.id("cMessagingEndpoint_1")
.doCatch(Exception.class)
.process(new org.apache.camel.Processor() {
public void process(
org.apache.camel.Exchange exchange)
throws Exception {
exchange.getIn()
.setHeader(
"XSD_Validation_error",
exchange.getProperty("CamelExceptionCaught"));
System.out
.println("CamelExceptionCaught : "
+ exchange
.getProperty("CamelExceptionCaught"));
}
}).id("cProcessor_1").setHeader("AuditStep")
.constant("REST Consolider - failure").id(
"cSetHeader_3")
.to(uriMap.get("cJMS_2")).id("cJMS_2");
from(uriMap.get("target_JMS")).routeId("target_JMS")
.to(uriMap.get("output_queue")).id("cJMS_3");
}
};
getCamelContexts().get(0).addRoutes(routeBuilder);
}