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

HttpRestServletResolveConsumerStrategy should pick the path with longest prefix match

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.17.3
    • Fix Version/s: 2.19.0
    • Component/s: camel-http-common
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      HttpRestServletResolveConsumerStrategy should pick the path with longest prefix match.

      The JAX-RS specification has defined strict sorting and precedence rules for matching URI expressions and is based on a most specific match wins algorithm.

      For camel also it should be same.

      This is an example use case:

      @Override
      public final void configure() throws Exception {
      LOG.info("Configuring Camel routes");
      from("jetty:http://localhost:8080/crud?matchOnUriPrefix=true")
      .to("cxfbean:crudService");
      
      from("jetty:http://localhost:8080/?matchOnUriPrefix=true")
      .process(new StaticProcessor("/", "index.html", staticFileRoot));
      }
      

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              rcbose Chandra Bose Renganathan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: