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

Setting matchOnUriPrefix on netty-http Rest Component causes api route to fail

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 3.0.0
    • 3.0.1, 3.1.0
    • camel-netty-http
    • None
    • Patch Available
    • Unknown

    Description

      When using the rest dsl with the following configuration:

       restConfiguration().component("netty-http").port(8080)
                  .endpointProperty("matchOnUriPrefix", "true")
                  .apiContextPath("/api-doc").apiProperty("api.title", "Camel Examples Karaf Rest API")
                  .apiProperty("api.version", "1.0.0");

      Starting the /api-doc route throws the following error:

       org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: netty-http://http://localhost:8080/api-doc?httpMethodRestrict=GET&matchOnUriPrefix=true&matchOnUriPrefix=true due to: Error binding property (matchOnUriPrefix=[true, true]) with name: matchOnUriPrefix on bean: org.apache.camel.component.netty.http.NettyHttpConfiguration@2918e3d7 with value: [true, true] 

      This is because the NettyHttpComponent class hard codes matchOnUriPrefix  on this route so it is added twice.  This configuration should only be added if it does not already exists.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bob Bob Paulin
            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 - 1h 10m
                1h 10m