You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by lauri <la...@gmail.com> on 2011/01/07 20:46:55 UTC

Camel-http and multiple Set-Cookie headers

Hi,

I'm using Camel to integrate service A to service B using camel-http.
Service B is just an external web server that needs to set some cookies once
in a while. However, if multiple Set-Cookie headers are present in B's
responses, I'm only able to read one of them on A. The reason for this is
that org.apache.camel.Message seems to only have methods for handling
headers that can exist only once.

So, have I completely misunderstood something here or is this just some kind
of a limitation of camel-http module?

Best,
Lauri
-- 
View this message in context: http://camel.465427.n5.nabble.com/Camel-http-and-multiple-Set-Cookie-headers-tp3332393p3332393.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel-http and multiple Set-Cookie headers

Posted by Martin Krasser <kr...@googlemail.com>.
Already did it: https://issues.apache.org/jira/browse/CAMEL-3516

Also, the workaround I described previously only works on the server 
side (when HTTP responses are written). For reading multiple cookies 
from an HTTP response on the client side, an extension to HttpProducer 
is needed as well.

Am 09.01.11 09:54, schrieb Claus Ibsen:
> Hi
>
> Can you create a ticket in the issue tracker?
>
> Link is here
> http://camel.apache.org/support
>
>
> On Fri, Jan 7, 2011 at 8:46 PM, lauri<la...@gmail.com>  wrote:
>> Hi,
>>
>> I'm using Camel to integrate service A to service B using camel-http.
>> Service B is just an external web server that needs to set some cookies once
>> in a while. However, if multiple Set-Cookie headers are present in B's
>> responses, I'm only able to read one of them on A. The reason for this is
>> that org.apache.camel.Message seems to only have methods for handling
>> headers that can exist only once.
>>
>> So, have I completely misunderstood something here or is this just some kind
>> of a limitation of camel-http module?
>>
>> Best,
>> Lauri
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Camel-http-and-multiple-Set-Cookie-headers-tp3332393p3332393.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>

-- 
Martin Krasser

blog:    http://krasserm.blogspot.com
code:    http://github.com/krasserm
twitter: http://twitter.com/mrt1nz


Re: Camel-http and multiple Set-Cookie headers

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Can you create a ticket in the issue tracker?

Link is here
http://camel.apache.org/support


On Fri, Jan 7, 2011 at 8:46 PM, lauri <la...@gmail.com> wrote:
>
> Hi,
>
> I'm using Camel to integrate service A to service B using camel-http.
> Service B is just an external web server that needs to set some cookies once
> in a while. However, if multiple Set-Cookie headers are present in B's
> responses, I'm only able to read one of them on A. The reason for this is
> that org.apache.camel.Message seems to only have methods for handling
> headers that can exist only once.
>
> So, have I completely misunderstood something here or is this just some kind
> of a limitation of camel-http module?
>
> Best,
> Lauri
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-http-and-multiple-Set-Cookie-headers-tp3332393p3332393.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel-http and multiple Set-Cookie headers

Posted by Martin Krasser <kr...@googlemail.com>.
See also http://groups.google.com/group/akka-user/msg/30aa1b88510ee14e 
on the Akka ML.

Am 08.01.11 10:25, schrieb Dan Checkoway:
> How about this?
>
> http://commons.apache.org/collections/apidocs/org/apache/commons/collections/map/MultiValueMap.html
>
> That still implements Map, so users theoretically wouldn't have to change
> anything, or change much.  And those who need to grab Set-Cookie headers
> could use .getCollection() to access them all.
>
> Dan
>
> On Sat, Jan 8, 2011 at 3:41 AM, Willem Jiang<wi...@gmail.com>  wrote:
>
>> Camel message header is a map, so if there are more than one value with
>> same key set into the header, you can see only one entry in the message
>> header.
>> Maybe we need to find other way to work around it in camel-http component.
>>
>>
>> On 1/8/11 3:46 AM, lauri wrote:
>>
>>> Hi,
>>>
>>> I'm using Camel to integrate service A to service B using camel-http.
>>> Service B is just an external web server that needs to set some cookies
>>> once
>>> in a while. However, if multiple Set-Cookie headers are present in B's
>>> responses, I'm only able to read one of them on A. The reason for this is
>>> that org.apache.camel.Message seems to only have methods for handling
>>> headers that can exist only once.
>>>
>>> So, have I completely misunderstood something here or is this just some
>>> kind
>>> of a limitation of camel-http module?
>>>
>>> Best,
>>> Lauri
>>>
>>
>> --
>> Willem
>> ----------------------------------
>> FuseSource
>> Web: http://www.fusesource.com
>> Blog:    http://willemjiang.blogspot.com (English)
>>          http://jnn.javaeye.com (Chinese)
>> Twitter: willemjiang
>>

-- 
Martin Krasser

blog:    http://krasserm.blogspot.com
code:    http://github.com/krasserm
twitter: http://twitter.com/mrt1nz


Re: Camel-http and multiple Set-Cookie headers

Posted by Dan Checkoway <dc...@gmail.com>.
How about this?

http://commons.apache.org/collections/apidocs/org/apache/commons/collections/map/MultiValueMap.html

That still implements Map, so users theoretically wouldn't have to change
anything, or change much.  And those who need to grab Set-Cookie headers
could use .getCollection() to access them all.

Dan

On Sat, Jan 8, 2011 at 3:41 AM, Willem Jiang <wi...@gmail.com> wrote:

> Camel message header is a map, so if there are more than one value with
> same key set into the header, you can see only one entry in the message
> header.
> Maybe we need to find other way to work around it in camel-http component.
>
>
> On 1/8/11 3:46 AM, lauri wrote:
>
>>
>> Hi,
>>
>> I'm using Camel to integrate service A to service B using camel-http.
>> Service B is just an external web server that needs to set some cookies
>> once
>> in a while. However, if multiple Set-Cookie headers are present in B's
>> responses, I'm only able to read one of them on A. The reason for this is
>> that org.apache.camel.Message seems to only have methods for handling
>> headers that can exist only once.
>>
>> So, have I completely misunderstood something here or is this just some
>> kind
>> of a limitation of camel-http module?
>>
>> Best,
>> Lauri
>>
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>         http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
>

Re: Camel-http and multiple Set-Cookie headers

Posted by Willem Jiang <wi...@gmail.com>.
Camel message header is a map, so if there are more than one value with 
same key set into the header, you can see only one entry in the message 
header.
Maybe we need to find other way to work around it in camel-http component.

On 1/8/11 3:46 AM, lauri wrote:
>
> Hi,
>
> I'm using Camel to integrate service A to service B using camel-http.
> Service B is just an external web server that needs to set some cookies once
> in a while. However, if multiple Set-Cookie headers are present in B's
> responses, I'm only able to read one of them on A. The reason for this is
> that org.apache.camel.Message seems to only have methods for handling
> headers that can exist only once.
>
> So, have I completely misunderstood something here or is this just some kind
> of a limitation of camel-http module?
>
> Best,
> Lauri


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