Details
-
Type:
Improvement
-
Status: Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 2.17.1
-
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; }