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

Throw an exception or add a warning when multiple ToDefinitions are defined in Rest DSL

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

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 4.8.0
    • 4.9.0
    • camel-core, rest
    • None
    • Unknown

    Description

      Most of the route builder configurations allow multiple ToDefinitions, e.g.:

      from("direct:start")
          .process(e -> {})
          .to("micrometer:timer:timer-a")
          .to("direct:to-route-1)
          .to("micrometer:timer:timer-b")
          .to("direct:to-route-2) 
      

      But the Rest DSL only supports the last defined "to" component, any other "to" components are overwritten silently by Camel.

      Is it possible to add a mechanism in the Rest component to let the user know only the last "to" will be in use? Like in the org.apache.camel.model.rest.VerbDefinition#setTo method can an Assert being added to make sure this.to is null before the assignment?

       

      Attachments

        Activity

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

          People

            davsclaus Claus Ibsen
            shawnxfu Shawn Fu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment