[
https://issues.apache.org/jira/browse/CAMEL-13388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16810669#comment-16810669
]
Artem Ivanov commented on CAMEL-13388:
--------------------------------------
[~davsclaus], thx for that fix.
I found that when we use specific parameters for delegating component we get
parameters validation errors on general service component.
For example:
Service URI:
service:recaptcha-service:jetty:[http://0.0.0.0:2224/recaptcha?matchOnUriPrefix=true&throwExceptionOnFailure=false]
Camel creating endpoint
uri=[service://recaptcha-service:jetty:[http://0.0.0.0:2224/recaptcha?matchOnUriPrefix=true&throwExceptionOnFailure=false]|http://0.0.0.0:2224/recaptcha?matchOnUriPrefix=true&throwExceptionOnFailure=false],]
After that, camel creating endpoint with specific jetty parameters
uri=[jetty://http://0.0.0.0:2224/recaptcha?matchOnUriPrefix=true&throwExceptionOnFailure=false],
path=[[http://0.0.0.0:2224/recaptcha]]
But we get exception on route creation :
org.apache.camel.FailedToCreateRouteException: Failed to create route route2:
Route(route2)[[From[service:recaptcha-service:jetty:http://0... because of
Failed to resolve endpoint:
service://recaptcha-service:jetty:http://0.0.0.0:2224/recaptcha?matchOnUriPrefix=true&throwExceptionOnFailure=false
due to: Failed to resolve endpoint:
service://recaptcha-service:jetty:http://0.0.0.0:2224/recaptcha?matchOnUriPrefix=true&throwExceptionOnFailure=false
due to: There are 2 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=[\{matchOnUriPrefix=true,
throwExceptionOnFailure=false}]
ServiceComponent should ignore delegating parameters.
I think, that legal fix can be like that:
Class: org.apache.camel.component.service.ServiceEndpoint
{code:java}
@Override
public boolean isLenientProperties() {
return true;
} {code}
> Wrong removing parameters logic in ServiceComponent.
> ----------------------------------------------------
>
> Key: CAMEL-13388
> URL: https://issues.apache.org/jira/browse/CAMEL-13388
> Project: Camel
> Issue Type: Bug
> Affects Versions: 2.22.3, 2.23.1, 3.0.0-M1
> Reporter: Artem Ivanov
> Assignee: Claus Ibsen
> Priority: Major
> Labels: easyfix
> Fix For: 3.0.0, 2.23.2, 2.24.0, 2.22.4, 3.0.0-M3
>
>
> Component: camel-service
> Mistake in class : org.apache.camel.component.service.ServiceComponent.java:83
> This error prevents the delegating component from receiving URI parameters.
> *Have:*
> {code:java}
> parameters.keySet().removeAll(parameters.keySet());
> {code}
> *Must be:*
> {code:java}
> parameters.keySet().removeAll(params.keySet());
> {code}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)