Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.18.3, 3.19.0
-
None
-
Unknown
Description
I tried to make work the example in camel toD eip documentation page
from("direct:login") .setHeader(Exchange.HTTP_PATH, simple("/login")) .setHeader(Exchange.HTTP_QUERY, simple("userid=${header.userName}")) .toD("http:myloginserver:8080") .removeHeader(Exchange.HTTP_PATH) .removeHeader(Exchange.HTTP_QUERY);
but the header Exchange.HTTP_PATH is not used, so as result the following url is called:
http://myloginserver:8080?userid=xxx
and not
http://myloginserver:8080/login?userid=xxx
I debugged the code I found that the issue could be in the class org.apache.camel.http.base.HttpSendDynamicAware in the method createPreProcessor at line 96.
In this method the url in toD is parsed and the path is an empty string "", and it's not checked if the Exchange.HTTP_PATH is set.
I'm upgrading from camel 3.11.x and it used to work, but in that version there isn't the class HttpSendDynamicAware.
Is this the expected behavior?
Is there a way to make it work without changing the code?
Thanks