[
https://issues.apache.org/jira/browse/CAMEL-14921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17085193#comment-17085193
]
Claus Ibsen commented on CAMEL-14921:
-------------------------------------
[~gnodet] it seems code at
https://github.com/apache/camel/blob/e7120bbca852e784062f4f7c4c03b1508ebced0d/core/camel-base/src/main/java/org/apache/camel/impl/engine/AbstractCamelContext.java#L599
Was changed from calling init on the component to build. And that causes an
issue. We need to move the configurer resolving from init to build phase
> PahoEndpointBuilder not working
> -------------------------------
>
> Key: CAMEL-14921
> URL: https://issues.apache.org/jira/browse/CAMEL-14921
> Project: Camel
> Issue Type: Bug
> Components: camel-paho
> Affects Versions: 3.2.0
> Reporter: Eickvonder
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 3.3.0
>
>
> I'm struggling with the PahoEndpointBuilder in both 3.2.0 and current
> 3.3.0-SNAPSHOT.
> For testing purposes I have a simple route:
> {code}
> PahoEndpointBuilder endpointBuilder = paho (topic).brokerUrl
> (brokerUrl).userName (userName).password (password);
> from (endpointBuilder).log ("${body}");
> {code}
> The startup of the application fails with the following exception causes:
> {code}
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve
> endpoint:
> paho:myTestTopicMandant9?brokerUrl=tcp%3A%2F%2Flocalhost%3A1883&password=xxxxxx&userName=test
> due to: Failed to resolve endpoint:
> paho:myTestTopicMandant9?brokerUrl=tcp%3A%2F%2Flocalhost%3A1883&password=xxxxxx&userName=test
> due to: There are 3 parameters that couldn't be set on the endpoint. Check
> the uri if the parameters are spelt correctly and that they are properties of
> the endpoint. Unknown parameters=[{brokerUrl=tcp://localhost:1883,
> password=test123, userName=test}]
> at
> org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:971)
> at
> org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:893)
> at
> org.apache.camel.builder.endpoint.AbstractEndpointBuilder.resolve(AbstractEndpointBuilder.java:55)
> at
> org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:257)
> at
> org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:117)
> ... 43 more
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve
> endpoint:
> paho:myTestTopicMandant9?brokerUrl=tcp%3A%2F%2Flocalhost%3A1883&password=xxxxxx&userName=test
> due to: There are 3 parameters that couldn't be set on the endpoint. Check
> the uri if the parameters are spelt correctly and that they are properties of
> the endpoint. Unknown parameters=[{brokerUrl=tcp://localhost:1883,
> password=test123, userName=test}]
> at
> org.apache.camel.support.DefaultComponent.validateParameters(DefaultComponent.java:351)
> at
> org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:169)
> at
> org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:952)
> {code}
> Curiously if I add a single line of code inbetween that creates the endpoint
> out of the builder it all works:
> {code}
> PahoEndpointBuilder endpointBuilder = paho (topic).brokerUrl
> (brokerUrl).userName (userName).password (password);
> endpoint (endpointBuilder.getUri ());
> from (endpointBuilder).log ("${body}");
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)