Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14032

NotifyBuilder.from does not normalize endpoint URI

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0.RC1
    • Fix Version/s: 3.0.0.RC3, 3.0.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                srdo Stig Rohde Døssing
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m