Skip to content

Commit

Permalink
Migrate timer examples to 4.4 (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
Croway committed Mar 4, 2024
1 parent 8d9f290 commit 104966c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -81,12 +81,12 @@ public static class BasicCamelToReactorExampleRoutes extends RouteBuilder {
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");

Expand Down
Expand Up @@ -80,7 +80,7 @@ public static class BasicCamelToReactorInOutExampleRoutes extends RouteBuilder {
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
Expand Down
Expand Up @@ -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"
Expand Down

0 comments on commit 104966c

Please sign in to comment.