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 2026/05/21 21:16:04 UTC
(camel) 08/11: camel-jbang: Add application.properties to bundled examples
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch tui-run-options-and-features
in repository https://gitbox.apache.org/repos/asf/camel.git
commit d8e714e7e2bb8d72699208e60a2fdea9c46e5feb
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu May 21 22:47:24 2026 +0200
camel-jbang: Add application.properties to bundled examples
Use property placeholders in timer-log, cron-log, rest-api, and
routes examples so their values are configurable via properties.
Co-Authored-By: Claude <no...@anthropic.com>
---
.../examples/camel-jbang-example-catalog.json | 4 ++++
.../examples/cron-log/application.properties | 20 ++++++++++++++++++++
.../resources/examples/cron-log/cron-log.camel.yaml | 4 ++--
.../examples/rest-api/application.properties | 20 ++++++++++++++++++++
.../resources/examples/rest-api/rest-api.camel.yaml | 2 +-
.../resources/examples/routes/application.properties | 18 ++++++++++++++++++
.../src/main/resources/examples/routes/beans.yaml | 2 +-
.../examples/timer-log/application.properties | 20 ++++++++++++++++++++
.../examples/timer-log/timer-log.camel.yaml | 4 ++--
9 files changed, 88 insertions(+), 6 deletions(-)
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/camel-jbang-example-catalog.json b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/camel-jbang-example-catalog.json
index a9b467615531..4e42f22e97d8 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/camel-jbang-example-catalog.json
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/camel-jbang-example-catalog.json
@@ -96,6 +96,7 @@
"hasCitrusTests": false,
"files": [
"README.md",
+ "application.properties",
"cron-log.camel.yaml"
]
},
@@ -325,6 +326,7 @@
"hasCitrusTests": false,
"files": [
"README.md",
+ "application.properties",
"rest-api.camel.yaml"
]
},
@@ -344,6 +346,7 @@
"files": [
"Greeter.java",
"README.md",
+ "application.properties",
"beans.yaml",
"routes.camel.yaml"
]
@@ -431,6 +434,7 @@
"hasCitrusTests": false,
"files": [
"README.md",
+ "application.properties",
"timer-log.camel.yaml"
]
},
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/cron-log/application.properties b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/cron-log/application.properties
new file mode 100644
index 000000000000..a60bfaac62a6
--- /dev/null
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/cron-log/application.properties
@@ -0,0 +1,20 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+# Timer period in milliseconds
+cron.period=5000
+# Log message prefix
+cron.message=Scheduled task running at
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/cron-log/cron-log.camel.yaml b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/cron-log/cron-log.camel.yaml
index fd729c9f5ea0..2ccc3b93c7c9 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/cron-log/cron-log.camel.yaml
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/cron-log/cron-log.camel.yaml
@@ -20,8 +20,8 @@
from:
uri: timer:cron
parameters:
- period: "5000"
+ period: "{{cron.period}}"
steps:
- setBody:
- simple: "Scheduled task running at ${date:now:HH:mm:ss}"
+ simple: "{{cron.message}} ${date:now:HH:mm:ss}"
- log: "${body}"
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/rest-api/application.properties b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/rest-api/application.properties
new file mode 100644
index 000000000000..7f4c4e3284c3
--- /dev/null
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/rest-api/application.properties
@@ -0,0 +1,20 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+# HTTP server port
+camel.server.port=8080
+# Greeting message for the hello endpoint
+greeting.message=Hello from Camel REST API!
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/rest-api/rest-api.camel.yaml b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/rest-api/rest-api.camel.yaml
index dda5c6cba0fc..8bf9e16560e0 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/rest-api/rest-api.camel.yaml
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/rest-api/rest-api.camel.yaml
@@ -28,7 +28,7 @@
uri: direct:hello
steps:
- setBody:
- constant: "Hello from Camel REST API!"
+ constant: "{{greeting.message}}"
- route:
id: hello-name
from:
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/routes/application.properties b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/routes/application.properties
new file mode 100644
index 000000000000..f562742fc8e5
--- /dev/null
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/routes/application.properties
@@ -0,0 +1,18 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+# Greeting message used by the Greeter bean
+greeter.message=Hello!
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/routes/beans.yaml b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/routes/beans.yaml
index 70bc6a6d5d35..6b71f2f79d5d 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/routes/beans.yaml
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/routes/beans.yaml
@@ -19,4 +19,4 @@
- name: "greeter"
type: "camel.example.Greeter"
properties:
- message: 'Hello!'
+ message: '{{greeter.message}}'
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/timer-log/application.properties b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/timer-log/application.properties
new file mode 100644
index 000000000000..8f6509eb6b08
--- /dev/null
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/timer-log/application.properties
@@ -0,0 +1,20 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing, software
+## distributed under the License is distributed on an "AS IS" BASIS,
+## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+## See the License for the specific language governing permissions and
+## limitations under the License.
+## ---------------------------------------------------------------------------
+# Timer period in milliseconds
+timer.period=1000
+# Greeting message to log
+greeting.message=Hello Camel!
diff --git a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/timer-log/timer-log.camel.yaml b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/timer-log/timer-log.camel.yaml
index 48124209c60d..8488774e48d5 100644
--- a/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/timer-log/timer-log.camel.yaml
+++ b/dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/timer-log/timer-log.camel.yaml
@@ -20,8 +20,8 @@
from:
uri: timer:tick
parameters:
- period: "1000"
+ period: "{{timer.period}}"
steps:
- setBody:
- simple: "Hello Camel! (message #${exchangeProperty.CamelTimerCounter})"
+ simple: "{{greeting.message}} (message #${exchangeProperty.CamelTimerCounter})"
- log: "${body}"