Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.2.0
-
None
-
Unknown
Description
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:
PahoEndpointBuilder endpointBuilder = paho (topic).brokerUrl (brokerUrl).userName (userName).password (password);
from (endpointBuilder).log ("${body}");
The startup of the application fails with the following exception causes:
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)
Curiously if I add a single line of code inbetween that creates the endpoint out of the builder it all works:
PahoEndpointBuilder endpointBuilder = paho (topic).brokerUrl (brokerUrl).userName (userName).password (password);
endpoint (endpointBuilder.getUri ());
from (endpointBuilder).log ("${body}");