Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

JMS & REST Service : target message has an empty body

Hi all,
I designed a camel route to implement the following use case :
1. get a xml message from a queue (ActiveMq)
2. process it through a REST webservice to transform and consolidate the initial message into a new xml message
3. forward the REST response to another jms queue
the cLog shows that the message body is allright, but when I look in the queue, the body is void.
Could somebody give me any clue ?
main code :
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);
}

working on
ESB Professional Edition
Version: 5.1.3.r96646
0683p000009MEE6.jpg 0683p000009MEO3.jpg 0683p000009MEOD.jpg 0683p000009MEKw.jpg
Labels (6)
0 Replies