camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Query part of HTTP_URI header ignored
Date Sat, 08 Oct 2011 13:47:05 GMT
I just checked the code, the HttpProducer should not ignore the query 
part.
If there is no any other setting on HttpQuery header, we should let 
HttpProducer use the query part of the HTTP_URI header.

I just filled a JIRA[1] for it and will commit a fix shortly.

[1]https://issues.apache.org/jira/browse/CAMEL-4526


On Fri Oct  7 21:28:05 2011, wing-tung Leung wrote:
> We use a HttpProducer (http4) which receives a URL via the "CamelHttpUri"
> header, and fetches the data from that URL. The http4 endpoint configuration
> does not contain any URL at all, because this is all determined based on
> dynamic message content.
>
> Problem is that I initially expected that the query part of the URL would be
> taken into account, but the HTTP producer IGNORES the query parameter
> segment when the "CamelHttpQuery" header is not set. It seems to fallback to
> the query part of the endpoint, but that does not work for us since it's
> empty.
>
> So, setting URL directly on endpoint should respect the query part, but only
> setting it via the header, does NOT use the query part. I did not expect
> this behavior, and find it a little confusing. Wouldn't it be better to
> include the query part in BOTH cases?
>
> For the moment, I implemented a workaround by setting the CamelHttpQuery
> header as well, but this feels like a small hack.
>
>
> http://camel.apache.org/http4.html
>
> Using camel 2.5, but code seems to be unchanged in latest trunk, see line
> 331 in HttpProducer.createMethod() :
>
> https://github.com/apache/camel/blob/trunk/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpProducer.java#L331
>
> Regards,
>
> Tung
>



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


Mime
View raw message