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 2021/08/03 12:33:43 UTC
[camel] 13/22: CAMEL-16757: YAML DSL to support route configuration
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch CAMEL-16757b
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 0a6b029340427032ab928f46eba677f65fe4c98a
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Aug 2 17:11:00 2021 +0200
CAMEL-16757: YAML DSL to support route configuration
---
.../src/main/java/org/apache/camel/impl/DefaultModel.java | 12 ++++++++++--
1 file changed, 10 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 cc5db4c..475a975 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
@@ -120,7 +120,11 @@ public class DefaultModel implements Model {
if (routesConfiguration == null) {
return;
}
- this.routesConfigurations.add(routesConfiguration);
+ // only add if not already exists (route-loader may let Java DSL add route configuration twice
+ // because it extends RouteBuilder as base class)
+ if (!this.routesConfigurations.contains(routesConfiguration)) {
+ this.routesConfigurations.add(routesConfiguration);
+ }
}
@Override
@@ -128,7 +132,11 @@ public class DefaultModel implements Model {
if (routesConfigurations == null || routesConfigurations.isEmpty()) {
return;
}
- this.routesConfigurations.addAll(routesConfigurations);
+ // only add if not already exists (route-loader may let Java DSL add route configuration twice
+ // because it extends RouteBuilder as base class)
+ for (RouteConfigurationDefinition rc : routesConfigurations) {
+ addRouteConfiguration(rc);
+ }
}
@Override