diff --git a/camel/component/src/main/java/org/switchyard/component/camel/RouteFactory.java b/camel/component/src/main/java/org/switchyard/component/camel/RouteFactory.java index 6f48a204d..a6b5582fa 100644 --- a/camel/component/src/main/java/org/switchyard/component/camel/RouteFactory.java +++ b/camel/component/src/main/java/org/switchyard/component/camel/RouteFactory.java @@ -73,10 +73,17 @@ private RouteFactory() { * @return list of route definitions */ public static List getRoutes(CamelComponentImplementationModel model) { + List routes; if (model.getJavaClass() != null) { - return createRoute(model.getJavaClass(), model.getComponent().getTargetNamespace()); + routes = createRoute(model.getJavaClass(), model.getComponent().getTargetNamespace()); + } else { + routes = loadRoute(model.getXMLPath()); } - return loadRoute(model.getXMLPath()); + int i = 0; + for (RouteDefinition route : routes) { + route.setId(model.getComponent().getQName().toString().replace(':', '-') + "-" + ++i); + } + return routes; } /**