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

Dynamicaly Loaded XML Rests Bind to all RestConfigurations

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.17.1
    • Fix Version/s: 2.17.2, 2.18.0
    • Component/s: camel-core
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Unknown

      Description

      When dynamically loading a Rests xml, you need to call:

      xmlDef.asRouteDefinition(camelContext); 
      

      to created the routes, but it creates routes for every RestConfiguration in the camelContext. This can result in duplicate route errors.

      We should also be able to choose which RestConfiguration to bind to. Can we get the following Method added to org.camel.model.rest.RestDefinition:

      public List<RouteDefinition> asRouteDefinition(CamelContext camelContext, RestConfiguration restConfig) { 
              // sanity check this rest definition do not have duplicates 
              validateUniquePaths(); 
      
              List<RouteDefinition> answer = new ArrayList<RouteDefinition>(); 
              
              addRouteDefinition(camelContext, answer, restConfig.getComponent()); 
              
              return answer; 
          }
      

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              jmandawg Jay mann
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: