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 2014/12/09 15:51:03 UTC

[2/2] camel git commit: CAMEL-8313: rest-dsl use verb id as route id if no routeId was configured

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/6f99beb6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6f99beb6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6f99beb6

Branch: refs/heads/camel-2.14.x
Commit: 6f99beb6e170d5cca7d4b635cb0cff10efe1cc6c
Parents: 658b994
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Dec 9 15:48:12 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Dec 9 15:49:58 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/6f99beb6/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);