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

Reply via email to