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/01/29 08:04:27 UTC
[camel] 01/02: Update route-template.adoc (#6851)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
commit 759ae8dadcf8b1389677461f2ca00155480166dc
Author: Chirag <cs...@manh.com>
AuthorDate: Sat Jan 29 03:01:09 2022 -0500
Update route-template.adoc (#6851)
Clarifying that using with camelContext is Spring XML vs using routeTemplates is with XML DSL.
---
.../modules/ROOT/pages/route-template.adoc | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/docs/user-manual/modules/ROOT/pages/route-template.adoc b/docs/user-manual/modules/ROOT/pages/route-template.adoc
index 2885010..1d74a1c 100644
--- a/docs/user-manual/modules/ROOT/pages/route-template.adoc
+++ b/docs/user-manual/modules/ROOT/pages/route-template.adoc
@@ -34,7 +34,7 @@ public class MyRouteTemplates extends RouteBuilder {
}
----
-And in XML DSL
+And in Spring XML DSL
[source,xml]
----
@@ -52,6 +52,24 @@ And in XML DSL
</camelContext>
----
+And in XML DSL
+
+[source,xml]
+----
+<routeTemplates xmlns="http://camel.apache.org/schema/spring">
+ <routeTemplate id="myTemplate">
+ <templateParameter name="name"/>
+ <templateParameter name="greeting"/>
+ <templateParameter name="myPeriod" defaultValue="3s"/>
+ <route>
+ <from uri="timer:{{name}}?period={{myPeriod}}"/>
+ <setBody><simple>{{greeting}} ${body}</simple></setBody>
+ <log message="${body}"/>
+ </route>
+ </routeTemplate>
+</routeTemplates>
+----
+
In the examples above there was one route template, but you can define as many as you want.
Each template must have a unique id. The template parameters are used for defining the parameters
the template accepts. As you can see there are 3 parameters: name, greeting, and myPeriod. The first two