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-jbang-examples.git


The following commit(s) were added to refs/heads/main by this push:
     new 93d03f9  chore: Add application.properties to examples with property 
placeholders
93d03f9 is described below

commit 93d03f9d90ca5195dde47a6188aa0af2c5c937b2
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu May 21 23:17:26 2026 +0200

    chore: Add application.properties to examples with property placeholders
    
    Use property placeholders in timer-log, cron-log, rest-api, and
    routes examples so their values are configurable via properties.
    
    Co-Authored-By: Claude <[email protected]>
---
 cron-log/application.properties  | 4 ++++
 cron-log/cron-log.camel.yaml     | 4 ++--
 rest-api/application.properties  | 4 ++++
 rest-api/rest-api.camel.yaml     | 2 +-
 routes/application.properties    | 2 ++
 routes/beans.yaml                | 2 +-
 timer-log/application.properties | 4 ++++
 timer-log/timer-log.camel.yaml   | 4 ++--
 8 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/cron-log/application.properties b/cron-log/application.properties
new file mode 100644
index 0000000..b99fbbe
--- /dev/null
+++ b/cron-log/application.properties
@@ -0,0 +1,4 @@
+# Timer period in milliseconds
+cron.period=5000
+# Log message prefix
+cron.message=Scheduled task running at
diff --git a/cron-log/cron-log.camel.yaml b/cron-log/cron-log.camel.yaml
index a620a36..8739f72 100644
--- a/cron-log/cron-log.camel.yaml
+++ b/cron-log/cron-log.camel.yaml
@@ -4,12 +4,12 @@
       uri: timer
       parameters:
         timerName: cron
-        period: 5000
+        period: "{{cron.period}}"
       steps:
         - setBody:
             expression:
               simple:
-                expression: "Scheduled task running at ${date:now:HH:mm:ss}"
+                expression: "{{cron.message}} ${date:now:HH:mm:ss}"
         - log:
             message: "${body}"
 
diff --git a/rest-api/application.properties b/rest-api/application.properties
new file mode 100644
index 0000000..f3ee407
--- /dev/null
+++ b/rest-api/application.properties
@@ -0,0 +1,4 @@
+# HTTP server port
+camel.server.port=8080
+# Greeting message for the hello endpoint
+greeting.message=Hello from Camel REST API!
diff --git a/rest-api/rest-api.camel.yaml b/rest-api/rest-api.camel.yaml
index 8d2ce6e..d070e85 100644
--- a/rest-api/rest-api.camel.yaml
+++ b/rest-api/rest-api.camel.yaml
@@ -15,7 +15,7 @@
         - setBody:
             expression:
               constant:
-                expression: Hello from Camel REST API!
+                expression: "{{greeting.message}}"
 - route:
     id: hello-name
     from:
diff --git a/routes/application.properties b/routes/application.properties
new file mode 100644
index 0000000..9049d38
--- /dev/null
+++ b/routes/application.properties
@@ -0,0 +1,2 @@
+# Greeting message used by the Greeter bean
+greeter.message=Hello!
diff --git a/routes/beans.yaml b/routes/beans.yaml
index deeee34..a984e77 100644
--- a/routes/beans.yaml
+++ b/routes/beans.yaml
@@ -2,4 +2,4 @@
   - name: "greeter"
     type: "camel.example.Greeter"
     properties:
-      message: 'Hello!'
+      message: '{{greeter.message}}'
diff --git a/timer-log/application.properties b/timer-log/application.properties
new file mode 100644
index 0000000..370577a
--- /dev/null
+++ b/timer-log/application.properties
@@ -0,0 +1,4 @@
+# Timer period in milliseconds
+timer.period=1000
+# Greeting message to log
+greeting.message=Hello Camel!
diff --git a/timer-log/timer-log.camel.yaml b/timer-log/timer-log.camel.yaml
index 638582c..3e95c9e 100644
--- a/timer-log/timer-log.camel.yaml
+++ b/timer-log/timer-log.camel.yaml
@@ -4,12 +4,12 @@
       uri: timer
       parameters:
         timerName: tick
-        period: 1000
+        period: "{{timer.period}}"
       steps:
         - setBody:
             expression:
               simple:
-                expression: "Hello Camel! (message 
#${exchangeProperty.CamelTimerCounter})"
+                expression: "{{greeting.message}}"
         - log:
             message: "${body}"
 

Reply via email to