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/04/27 10:14:24 UTC

[camel-spring-boot] branch camel-spring-boot-3.7.x updated (a7d3533 -> a84f2bf)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch camel-spring-boot-3.7.x
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git.


    from a7d3533  Regen
     new ac93e17  CAMEL-16552: camel-spring-boot - Configuring route templates trouble setting route id when using spring yaml configuration
     new a84f2bf  CAMEL-16552: camel-spring-boot - Configuring route templates trouble setting route id when using spring yaml configuration

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../routetemplate/CamelRouteTemplateAutoConfiguration.java   | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

[camel-spring-boot] 02/02: CAMEL-16552: camel-spring-boot - Configuring route templates trouble setting route id when using spring yaml configuration

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-spring-boot-3.7.x
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit a84f2bf797673b2331834ab5734da472d0fe66a1
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Apr 27 12:12:40 2021 +0200

    CAMEL-16552: camel-spring-boot - Configuring route templates trouble setting route id when using spring yaml configuration
---
 .../boot/routetemplate/CamelRouteTemplateAutoConfiguration.java    | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routetemplate/CamelRouteTemplateAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routetemplate/CamelRouteTemplateAutoConfiguration.java
index 3fc76b7..3ccc775 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routetemplate/CamelRouteTemplateAutoConfiguration.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routetemplate/CamelRouteTemplateAutoConfiguration.java
@@ -43,21 +43,18 @@ public class CamelRouteTemplateAutoConfiguration {
         PropertiesRouteTemplateParametersSource source = new PropertiesRouteTemplateParametersSource();
         int counter = 0;
         for (Map<String, String> e : rt.getConfig()) {
-            boolean customRouteId = true;
             String routeId = e.remove("routeId");
             if (routeId == null) {
                 routeId = e.remove("route-id");
             }
             if (routeId == null) {
                 routeId = String.valueOf(counter);
-                customRouteId = false;
+                // use counter as route id since none was specified
+                counter++;
             }
             for (Map.Entry<String, String> entry : e.entrySet()) {
                 source.addParameter(routeId, entry.getKey(), entry.getValue());
             }
-            if (!customRouteId) {
-                counter++;
-            }
         }
 
         camelContext.getRegistry().bind("CamelSpringBootRouteTemplateParametersSource", RouteTemplateParameterSource.class, source);

[camel-spring-boot] 01/02: CAMEL-16552: camel-spring-boot - Configuring route templates trouble setting route id when using spring yaml configuration

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-spring-boot-3.7.x
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git

commit ac93e17835cd3650c003f2947b7997f9c8b5730f
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Apr 27 12:09:04 2021 +0200

    CAMEL-16552: camel-spring-boot - Configuring route templates trouble setting route id when using spring yaml configuration
---
 .../CamelRouteTemplateAutoConfiguration.java              | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routetemplate/CamelRouteTemplateAutoConfiguration.java b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routetemplate/CamelRouteTemplateAutoConfiguration.java
index 437e73b..3fc76b7 100644
--- a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routetemplate/CamelRouteTemplateAutoConfiguration.java
+++ b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/routetemplate/CamelRouteTemplateAutoConfiguration.java
@@ -43,10 +43,21 @@ public class CamelRouteTemplateAutoConfiguration {
         PropertiesRouteTemplateParametersSource source = new PropertiesRouteTemplateParametersSource();
         int counter = 0;
         for (Map<String, String> e : rt.getConfig()) {
+            boolean customRouteId = true;
+            String routeId = e.remove("routeId");
+            if (routeId == null) {
+                routeId = e.remove("route-id");
+            }
+            if (routeId == null) {
+                routeId = String.valueOf(counter);
+                customRouteId = false;
+            }
             for (Map.Entry<String, String> entry : e.entrySet()) {
-                source.addParameter(String.valueOf(counter), entry.getKey(), entry.getValue());
+                source.addParameter(routeId, entry.getKey(), entry.getValue());
+            }
+            if (!customRouteId) {
+                counter++;
             }
-            counter++;
         }
 
         camelContext.getRegistry().bind("CamelSpringBootRouteTemplateParametersSource", RouteTemplateParameterSource.class, source);