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 2019/10/14 10:05:00 UTC

[jira] [Resolved] (CAMEL-14032) NotifyBuilder.from does not normalize endpoint URI

     [ https://issues.apache.org/jira/browse/CAMEL-14032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-14032.
---------------------------------
    Resolution: Fixed

Thanks for reporting and the PR

> NotifyBuilder.from does not normalize endpoint URI
> --------------------------------------------------
>
>                 Key: CAMEL-14032
>                 URL: https://issues.apache.org/jira/browse/CAMEL-14032
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>    Affects Versions: 3.0.0.RC1
>            Reporter: Stig Rohde Døssing
>            Priority: Minor
>             Fix For: 3.0.0.RC3, 3.0.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> When using NotifyBuilder.from, it is possible to supply both a URI pattern and an actual URI for matching. NotifyBuilder matches actual endpoint URIs against the specified pattern using EndpointHelper.matchEndpoint(URI endpointUri, String pattern), which does either exact or regex matching. Before matching, matchEndpoint will normalize the URI in order to ensure that e.g. query parameter order doesn't matter.
> It would be nice if NotifyBuilder.from would attempt to normalize the pattern/URI specified in the "from" method. If it isn't possible to normalize, the pattern can be passed to matchEndpoint without modification, but if the "from" method is used with a concrete URI, query parameter order there can be some surprising behavior during the matching.
> For example, given a route like
> from("sjms:queue:my-queue?transacted=true&consumerCount=1")
> the following will not match
> new NotifyBuilder()
> .from("sjms:queue:my-queue?transacted=true&consumerCount=1")
> The reason for this is that Camel will normalize the route URI given in the actual route before passing it to EndpointHelper, but the pattern given to NotifyBuilder is not normalized, so the order of query parameters end up not matching.
> It would be good to either update NotifyBuilder so it tries normalizing the URI, or updating EndpointHelper.matchEndpoint, so it tries normalizing both the URI parameter and the pattern parameter.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)