You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2012/04/23 08:49:54 UTC

[jira] [Commented] (CAMEL-5183) EndpointConfiguration - Looses parameters if there is a name clash with known tokens

    [ https://issues.apache.org/jira/browse/CAMEL-5183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13259419#comment-13259419 ] 

Claus Ibsen commented on CAMEL-5183:
------------------------------------

This is a bad, as the API with getParameter do not differentiate between query parameters and uri parts.

I wonder if the API should be divided, so there is an API for the URI pieces such as
- host
- port
- userInfo
- authority
- etc.

And then another API for query parameters which is possible what people would like a nice API for to get/set.

The unit test above, shows 2 issues
- the endpoint configuration fails to create the same uri it was given (it looses parameters etc.)
- the endpoint configuration cannot get the port query parameter, as currently you will get 8080 as the port value.
                
> EndpointConfiguration - Looses parameters if there is a name clash with known tokens
> ------------------------------------------------------------------------------------
>
>                 Key: CAMEL-5183
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5183
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.9.3, 2.10.0
>
>
> The endpoint configuration introduced in Camel 2.9 introduces more issues than per see. We should use the previous logic by default, and allow custom components to use a 3rd party EndpointConfiguration if they need to.
> For example if you have a uri parameter named {{port}} then that is lost
> Given the test below it fails
> {code}
>     @Test
>     public void testConfigurationPortParameter() throws Exception {
>         EndpointConfiguration cfg1 = ConfigurationHelper.createConfiguration("mapped://foo:8080?one=true&two=2&port=123", context);
>         String uri1 = cfg1.toUriString(EndpointConfiguration.UriFormat.Complete);
>         assertEquals("mapped://foo:8080?one=true&two=2&port=123", uri1);
>     }
> {code}
> There is other facts with this EndpointConfiguration that causes side-effects as the previous logic was based on URISupport to parse the uris and whatnot. But the EndpointConfiguration introduced a new logic for that, and they are not identical.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira