You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/07/25 16:11:07 UTC
[camel] 02/02: CAMEL-18262: Polished
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch camel-3.18.x
in repository https://gitbox.apache.org/repos/asf/camel.git
commit d30b4c7bc36060034cba28bb0557a04ffa2ddbaa
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Jul 25 17:01:36 2022 +0200
CAMEL-18262: Polished
---
.../src/main/java/org/apache/camel/impl/DefaultModel.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultModel.java b/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultModel.java
index 793c29fa05b..477b67a62fa 100644
--- a/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultModel.java
+++ b/core/camel-core-engine/src/main/java/org/apache/camel/impl/DefaultModel.java
@@ -417,12 +417,15 @@ public class DefaultModel implements Model {
"duplicate id detected: " + duplicate + ". Please correct ids to be unique among all your routes.");
}
- addRouteDefinition(def);
-
+ // must use route collection to prepare the created route to
+ // ensure its created correctly from the route template
RoutesDefinition routeCollection = new RoutesDefinition();
routeCollection.setCamelContext(camelContext);
routeCollection.setRoutes(getRouteDefinitions());
routeCollection.prepareRoute(def);
+
+ // add route and return the id it was assigned
+ addRouteDefinition(def);
return def.getId();
}