You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/10/11 12:56:00 UTC

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

     [ https://issues.apache.org/jira/browse/CAMEL-14032?focusedWorklogId=326883&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-326883 ]

ASF GitHub Bot logged work on CAMEL-14032:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Oct/19 12:55
            Start Date: 11/Oct/19 12:55
    Worklog Time Spent: 10m 
      Work Description: srdo commented on pull request #3245: CAMEL-14032: Make EndpointHelper.matchEndpoint try to URI normalize t…
URL: https://github.com/apache/camel/pull/3245
 
 
   …he pattern to match, if there is not otherwise a match
   
   See https://issues.apache.org/jira/browse/CAMEL-14032
   
   We only try normalizing the pattern if the string contains '?', since otherwise there are no query parameters to reorder.
   
   The attempt at normalization of the pattern parameter should only happen if matching would otherwise fail, since I think it is risky to try normalizing the pattern before we know if it might contain e.g. a valid regex. This is also why the normalized pattern is only checked for exact match, and not any kind of pattern matching.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 326883)
    Remaining Estimate: 0h
            Time Spent: 10m

> 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: 10m
>  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)