You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Henrik Karlsson (Jira)" <ji...@apache.org> on 2021/10/07 08:31:00 UTC
[jira] [Created] (CAMEL-17049) authUsername and authPassword
parameters not passed to the underlaying endpoint
Henrik Karlsson created CAMEL-17049:
---------------------------------------
Summary: 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.0, 3.11.2, 3.11.1
Reporter: Henrik Karlsson
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)