You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Jason Chaffee <jc...@shopzilla.com> on 2012/12/13 03:39:52 UTC

losing headers after mondodb endpoint

I am processing a REST call using CXFRS and then sending that to a mongodb endpoint, and finally building up the Response for the CXFRS endpoint.  I would like to access the headers that CXFRS puts in the Exchange when I build up the Response (I probably need to get some Context objects out of the body as well).  However, the mondodb endpoint gives me a new Exchange with all of the headers gone.

How can I best handle this?

The only thing I can think of at this point is to do a processor and have a producer in the processor that sends a message to the mongodb endpoint and then I can take that result and continue use the Exchange that came in from the CXFRS call into the processor.

Are there any other options?

Jason



Re: losing headers after mondodb endpoint

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Dec 13, 2012 at 3:39 AM, Jason Chaffee <jc...@shopzilla.com> wrote:
> I am processing a REST call using CXFRS and then sending that to a mongodb endpoint, and finally building up the Response for the CXFRS endpoint.  I would like to access the headers that CXFRS puts in the Exchange when I build up the Response (I probably need to get some Context objects out of the body as well).  However, the mondodb endpoint gives me a new Exchange with all of the headers gone.
>
> How can I best handle this?
>

You can use the content enricher eip
http://camel.apache.org/content-enricher.html

But often the Camel components "respect" the old headers and leave the
as is, eg populate the existing headers.
Maybe we should look into have mongodb do the same?


> The only thing I can think of at this point is to do a processor and have a producer in the processor that sends a message to the mongodb endpoint and then I can take that result and continue use the Exchange that came in from the CXFRS call into the processor.
>
> Are there any other options?
>
> Jason
>
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: losing headers after mondodb endpoint

Posted by Jason Chaffee <jc...@shopzilla.com>.
I like that idea, but there could be a situation where it is distributed, meaning there is either a MQ between them for store and forward or DOSGI.

On Dec 12, 2012, at 8:15 PM, "Willem jiang" <wi...@gmail.com> wrote:

> Hi,  
> 
> You may consider to store those headers into exchange properties.  
> Camel will help you to copy exchange properties across the endpoints by default if they are not in the different JVM.
> 
> --  
> Willem Jiang
> 
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang  
> Weibo: 姜宁willem
> 
> 
> 
> 
> On Thursday, December 13, 2012 at 10:39 AM, Jason Chaffee wrote:
> 
>> I am processing a REST call using CXFRS and then sending that to a mongodb endpoint, and finally building up the Response for the CXFRS endpoint. I would like to access the headers that CXFRS puts in the Exchange when I build up the Response (I probably need to get some Context objects out of the body as well). However, the mondodb endpoint gives me a new Exchange with all of the headers gone.
>> 
>> How can I best handle this?
>> 
>> The only thing I can think of at this point is to do a processor and have a producer in the processor that sends a message to the mongodb endpoint and then I can take that result and continue use the Exchange that came in from the CXFRS call into the processor.
>> 
>> Are there any other options?
>> 
>> Jason  
> 
> 
> 

Re: losing headers after mondodb endpoint

Posted by Willem jiang <wi...@gmail.com>.
Hi,  

You may consider to store those headers into exchange properties.  
Camel will help you to copy exchange properties across the endpoints by default if they are not in the different JVM.

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem




On Thursday, December 13, 2012 at 10:39 AM, Jason Chaffee wrote:

> I am processing a REST call using CXFRS and then sending that to a mongodb endpoint, and finally building up the Response for the CXFRS endpoint. I would like to access the headers that CXFRS puts in the Exchange when I build up the Response (I probably need to get some Context objects out of the body as well). However, the mondodb endpoint gives me a new Exchange with all of the headers gone.
>  
> How can I best handle this?
>  
> The only thing I can think of at this point is to do a processor and have a producer in the processor that sends a message to the mongodb endpoint and then I can take that result and continue use the Exchange that came in from the CXFRS call into the processor.
>  
> Are there any other options?
>  
> Jason  



Re: losing headers after mondodb endpoint

Posted by Jason Chaffee <jc...@shopzilla.com>.
Yep, it is fixed now.



On 12/13/12 1:06 AM, "Raul Kripalani" <ra...@evosent.com> wrote:

>Hi Jason,
>
>This was fixed in Camel 2.10.3:
>https://issues.apache.org/jira/browse/CAMEL-5697.
>
>Could you try with that version and let us know?
>
>Regards,
>Raúl.
>On 13 Dec 2012 02:40, "Jason Chaffee" <jc...@shopzilla.com> wrote:
>
>> I am processing a REST call using CXFRS and then sending that to a
>>mongodb
>> endpoint, and finally building up the Response for the CXFRS endpoint.
>>I
>> would like to access the headers that CXFRS puts in the Exchange when I
>> build up the Response (I probably need to get some Context objects out
>>of
>> the body as well).  However, the mondodb endpoint gives me a new
>>Exchange
>> with all of the headers gone.
>>
>> How can I best handle this?
>>
>> The only thing I can think of at this point is to do a processor and
>>have
>> a producer in the processor that sends a message to the mongodb endpoint
>> and then I can take that result and continue use the Exchange that came
>>in
>> from the CXFRS call into the processor.
>>
>> Are there any other options?
>>
>> Jason
>>
>>
>>


Re: losing headers after mondodb endpoint

Posted by Raul Kripalani <ra...@evosent.com>.
Hi Jason,

This was fixed in Camel 2.10.3:
https://issues.apache.org/jira/browse/CAMEL-5697.

Could you try with that version and let us know?

Regards,
Raúl.
On 13 Dec 2012 02:40, "Jason Chaffee" <jc...@shopzilla.com> wrote:

> I am processing a REST call using CXFRS and then sending that to a mongodb
> endpoint, and finally building up the Response for the CXFRS endpoint.  I
> would like to access the headers that CXFRS puts in the Exchange when I
> build up the Response (I probably need to get some Context objects out of
> the body as well).  However, the mondodb endpoint gives me a new Exchange
> with all of the headers gone.
>
> How can I best handle this?
>
> The only thing I can think of at this point is to do a processor and have
> a producer in the processor that sends a message to the mongodb endpoint
> and then I can take that result and continue use the Exchange that came in
> from the CXFRS call into the processor.
>
> Are there any other options?
>
> Jason
>
>
>