camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] camel git commit: CAMEL-8313: rest-dsl use verb id as route id if no routeId was configured
Date Tue, 09 Dec 2014 14:51:02 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.14.x 658b99497 -> 6f99beb6e
  refs/heads/master 123c44204 -> ed107c895


CAMEL-8313: rest-dsl use verb id as route id if no routeId was configured


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ed107c89
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ed107c89
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ed107c89

Branch: refs/heads/master
Commit: ed107c8953cdd43ca5b128aad15e21b6014df144
Parents: 123c442
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Dec 9 15:48:12 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Dec 9 15:48:12 2014 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/model/rest/RestDefinition.java    | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ed107c89/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
index 64128cd..68e3686 100644
--- a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
@@ -466,7 +466,14 @@ public class RestDefinition extends OptionalIdentifiedDefinition<RestDefinition>
             if (outType != null) {
                 options.put("outType", outType);
             }
-            // include route id
+            // if no route id has been set, then use the verb id as route id
+            if (!route.hasCustomIdAssigned()) {
+                // use id of verb as route id
+                String id = verb.getId();
+                if (id != null) {
+                    route.setId(id);
+                }
+            }
             String routeId = route.idOrCreate(camelContext.getNodeIdFactory());
             options.put("routeId", routeId);
 


Mime
View raw message