On Thu, Mar 15, 2012 at 7:43 PM, cgsk <karthik2...@gmail.com> wrote: > Hello there, > > I am new to Camel. I am consuming a service request from a JMS queue and > calling an external REST service using CXFRS and processing the response. > But however, the JMSHeaders/custom headers which was in the message when > consuming from request queue is getting removed after calling the rest > service. > > Below is the code snippet: > > from("jms:request") > .log("CorrelationID: ${header.JMSCorrelationID}") > > .to(ISEATZ_SERVICE_URL+serviceMap.get(ISeatzConstant.HOTELRATERULES)) > .log("CorrelationID: ${header.JMSCorrelationID}") > > First log prints the correlation Id whereas the second log statement prints > empts correleationID. Am I missing something? Kindly help. >
The REST service most likely do not send back the correlationID in its response. If you want to preserve data during routing you can store data as properties on the Exchange which is kept during the lifecycle. Where as headers on a message is part of the message format, and its up to the various transports whats included or not. An alternative EIP is to use a content enricher http://camel.apache.org/content-enricher.html Then you can "merge" in the response from the REST service with the existing message. But for that you would need to code some java code in an AggregationStrategy. > > -- > View this message in context: > http://camel.465427.n5.nabble.com/CXFRS-producer-removing-JMS-headers-tp5568925p5568925.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/