[
https://issues.apache.org/jira/browse/CAMEL-17049?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-17049.
---------------------------------
Fix Version/s: 3.11.4
Resolution: Fixed
> authUsername and authPassword parameters not passed to the underlaying
> endpoint
> -------------------------------------------------------------------------------
>
> Key: CAMEL-17049
> URL: https://issues.apache.org/jira/browse/CAMEL-17049
> Project: Camel
> Issue Type: Bug
> Components: camel-http, camel-rest-openapi
> Affects Versions: 3.11.1, 3.11.2, 3.11.0
> Reporter: Henrik Karlsson
> Priority: Minor
> Fix For: 3.11.4, 3.13.0
>
>
> This is related to CAMEL-17043. The parameters authUsername and authPassword
> needs to be available then the endpoints is created which the aren't even
> after the changes in CAMEL-17043. In the method createProducer in
> HttpComponent the endpoint is created like this:
> {code:java}
> HttpEndpoint endpoint = camelContext.getEndpoint(url, HttpEndpoint.class);
> setProperties(endpoint, parameters);
> {code}
> Then setProperties is called it's to late because the authentication is
> already set on the endpoint. The signature of the getEndpoint used looks like
> this:
> {code:java}
> <T extends Endpoint> T getEndpoint(String name, Class<T> endpointType);
> {code}
> It feels a bit strange to use the url as name for the endpoint. So I found
> this variant for getEndpoint:
> {code:java}
> Endpoint getEndpoint(String uri, Map<String, Object> parameters);
> {code}
> Replacing the two lines above with this one solves the problem:
> {code:java}
> HttpEndpoint endpoint = (HttpEndpoint) camelContext.getEndpoint(url,
> parameters);
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)