camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: CXFRS producer removing JMS headers
Date Fri, 16 Mar 2012 05:12:24 GMT
On Thu, Mar 15, 2012 at 7:43 PM, cgsk <> 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

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:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
CamelOne 2012 Conference, May 15-16, 2012:
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message