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

REST DSL (With Servlet Component) Fails to Resolve Endpoint if Query Parameter Is Part of URI Parameter

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.11.4
    • 3.14.0
    • camel-core
    • None
    • Unknown

    Description

      The following works with Camel versions 3.11.3 and 3.13.0 but fails with version 3.11.4:

      rest("/Assertion?authTokenSourceUri={" + HEADER_AUTH_TOKEN_SOURCE_URI + "}").id(ROUTE_REST_GET_ASSERTION)
          .get()
          .produces(MediaType.TEXT_XML_VALUE)
          .route()
          // route definition omitted
      

      With version 3.11.4 this yields an org.apache.camel.ResolveEndpointFailedException:

      Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: servlet:///Assertion?httpMethodRestrict=GET due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{authTokenSourceUri={authTokenSourceUri}?consumerComponentName=servlet}]
      

      Specifying the query parameter via DSL works with all three versions:

      rest("/Assertion").id(ROUTE_REST_GET_ASSERTION)
          .get()
          .param()
              .name(HEADER_AUTH_TOKEN_SOURCE_URI)
              .type(RestParamType.query)
          .endParam()
          // rest is same as above
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            ralfsteppacher Ralf Steppacher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment