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 2024/03/04 15:38:34 UTC

(camel-spring-boot-examples) branch main updated: Migrate timer examples to 4.4 (#125)

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 104966c  Migrate timer examples to 4.4 (#125)
104966c is described below

commit 104966c304c174b9f19179a0e141c7e5a89f2ecb
Author: Federico Mariani <34...@users.noreply.github.com>
AuthorDate: Mon Mar 4 16:38:30 2024 +0100

    Migrate timer examples to 4.4 (#125)
---
 .../camel/example/reactive/streams/BasicCamelToReactorExample.java    | 4 ++--
 .../example/reactive/streams/BasicCamelToReactorInOutExample.java     | 2 +-
 routes-configuration/src/main/resources/myroutes/my-yaml-route.yaml   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/reactive-streams/src/main/java/org/apache/camel/example/reactive/streams/BasicCamelToReactorExample.java b/reactive-streams/src/main/java/org/apache/camel/example/reactive/streams/BasicCamelToReactorExample.java
index d175257..f15bc42 100644
--- a/reactive-streams/src/main/java/org/apache/camel/example/reactive/streams/BasicCamelToReactorExample.java
+++ b/reactive-streams/src/main/java/org/apache/camel/example/reactive/streams/BasicCamelToReactorExample.java
@@ -81,12 +81,12 @@ public class BasicCamelToReactorExample {
         public void configure() throws Exception {
 
             // Generating numbers every 5 seconds and forwarding to the stream "numbers"
-            from("timer:clock?period=5000")
+            from("timer:clock?period=5000&includeMetadata=true")
                     .setBody().header(Exchange.TIMER_COUNTER)
                     .to("reactive-streams:numbers");
 
             // Generating strings every 4.9 seconds and forwarding to the stream "strings"
-            from("timer:clock2?period=4900&delay=2000")
+            from("timer:clock2?period=4900&delay=2000&includeMetadata=true")
                     .setBody().simple("Hello World ${header.CamelTimerCounter}!")
                     .to("reactive-streams:strings");
 
diff --git a/reactive-streams/src/main/java/org/apache/camel/example/reactive/streams/BasicCamelToReactorInOutExample.java b/reactive-streams/src/main/java/org/apache/camel/example/reactive/streams/BasicCamelToReactorInOutExample.java
index 3f61266..cea1118 100644
--- a/reactive-streams/src/main/java/org/apache/camel/example/reactive/streams/BasicCamelToReactorInOutExample.java
+++ b/reactive-streams/src/main/java/org/apache/camel/example/reactive/streams/BasicCamelToReactorInOutExample.java
@@ -80,7 +80,7 @@ public class BasicCamelToReactorInOutExample {
         public void configure() throws Exception {
 
             // Generate a Id and retrieve user data from reactor
-            from("timer:clock?period=9000&delay=1500")
+            from("timer:clock?period=9000&delay=1500&includeMetadata=true")
                     .setBody().header(Exchange.TIMER_COUNTER).convertBodyTo(Long.class) // Sample ID
                     .bean("userBean", "getUserInfo") // Get the user info from reactor code
                     .process(new UnwrapStreamProcessor()) // Unwrap the Publisher
diff --git a/routes-configuration/src/main/resources/myroutes/my-yaml-route.yaml b/routes-configuration/src/main/resources/myroutes/my-yaml-route.yaml
index 3639f6d..73340eb 100644
--- a/routes-configuration/src/main/resources/myroutes/my-yaml-route.yaml
+++ b/routes-configuration/src/main/resources/myroutes/my-yaml-route.yaml
@@ -19,7 +19,7 @@
     # refer to the route configuration by the id to use for this route
     routeConfigurationId: "yamlError"
     from:
-      uri: "timer:yaml?period=3s"
+      uri: "timer:yaml?period=3s&includeMetadata=true"
       steps:
         - setBody:
             simple: "Timer fired ${header.CamelTimerCounter} times"