You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by cgsk <ka...@gmail.com> on 2012/03/15 19:43:50 UTC

CXFRS producer removing JMS headers

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.


--
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.

Re: CXFRS producer removing JMS headers

Posted by cgsk <ka...@gmail.com>.
Thanks for the patch.

--
View this message in context: http://camel.465427.n5.nabble.com/CXFRS-producer-removing-JMS-headers-tp5568925p5590157.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXFRS producer removing JMS headers

Posted by Willem Jiang <wi...@gmail.com>.
Just FYI, I committed a patch into the trunk, camel-2.9.x and 
camel-2.8.x branch.
Please feel free to check out the latest snapshot for verification.

On Mon Mar 19 22:21:36 2012, Willem Jiang wrote:
> It looks like a bug of cxfrs, I just fill a JIRA[1] for it.
> [1]https://issues.apache.org/jira/browse/CAMEL-5107
>
> On Sun Mar 18 02:18:09 2012, cgsk wrote:
>> Thanks for the response.
>>
>> But when I use spring-ws the header params are retained. why this 
>> behaviour
>> is differing in cxfrs?
>>
>> -- 
>> View this message in context: 
>> http://camel.465427.n5.nabble.com/CXFRS-producer-removing-JMS-headers-tp5568925p5574037.html 
>>
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>



-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang 
Weibo: willemjiang 


Re: CXFRS producer removing JMS headers

Posted by Willem Jiang <wi...@gmail.com>.
It looks like a bug of cxfrs, I just fill a JIRA[1] for it.
[1]https://issues.apache.org/jira/browse/CAMEL-5107

On Sun Mar 18 02:18:09 2012, cgsk wrote:
> Thanks for the response.
>
> But when I use spring-ws the header params are retained. why this behaviour
> is differing in cxfrs?
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CXFRS-producer-removing-JMS-headers-tp5568925p5574037.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Re: CXFRS producer removing JMS headers

Posted by cgsk <ka...@gmail.com>.
Thanks for the response. 

But when I use spring-ws the header params are retained. why this behaviour
is differing in cxfrs?

--
View this message in context: http://camel.465427.n5.nabble.com/CXFRS-producer-removing-JMS-headers-tp5568925p5574037.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: CXFRS producer removing JMS headers

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Mar 15, 2012 at 7:43 PM, cgsk <ka...@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: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/