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-spring-boot-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new c2a9102  Update example with a little longer route
c2a9102 is described below

commit c2a9102dea52fc3a1f408140c57843de508884ac
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Dec 22 10:53:53 2021 +0100

    Update example with a little longer route
---
 xml/src/main/resources/camel/my-route.xml | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/xml/src/main/resources/camel/my-route.xml 
b/xml/src/main/resources/camel/my-route.xml
index 300d8ae..635d36a 100644
--- a/xml/src/main/resources/camel/my-route.xml
+++ b/xml/src/main/resources/camel/my-route.xml
@@ -18,15 +18,26 @@
 
 -->
 <routes xmlns="http://camel.apache.org/schema/spring";>
+
     <route id="hello">
-      <from uri="timer:hello?period={{timer.period}}"/>
-      <transform>
-        <method ref="myBean" method="saySomething"/>
-      </transform>
-      <filter>
-        <simple>${body} contains 'foo'</simple>
-        <to uri="log:foo"/>
-      </filter>
-      <to uri="stream:out"/>
+        <from uri="timer:hello?period={{timer.period}}"/>
+
+        <transform>
+            <method ref="myBean" method="saySomething"/>
+        </transform>
+
+        <setHeader name="number">
+            <simple>${random(0,10)}</simple>
+        </setHeader>
+
+        <filter>
+            <simple>${header.number} > 4</simple>
+            <transform>
+                <simple>Random ${body}</simple>
+            </transform>
+        </filter>
+
+        <to uri="stream:out"/>
     </route>
+
 </routes>

Reply via email to