camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wing-tung Leung <wingtung.le...@gmail.com>
Subject Query part of HTTP_URI header ignored
Date Fri, 07 Oct 2011 13:28:05 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message