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-k.git
The following commit(s) were added to refs/heads/main by this push:
new 4eda7fc Update docs with another example to runtime properties.
Reported on chat room by end user.
4eda7fc is described below
commit 4eda7fc0943687a85eb47787c58b9275cdcf25dc
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Dec 15 07:10:16 2021 +0100
Update docs with another example to runtime properties. Reported on chat
room by end user.
---
.../ROOT/pages/configuration/runtime-properties.adoc | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/docs/modules/ROOT/pages/configuration/runtime-properties.adoc
b/docs/modules/ROOT/pages/configuration/runtime-properties.adoc
index 4fc3b94..69b7d33 100644
--- a/docs/modules/ROOT/pages/configuration/runtime-properties.adoc
+++ b/docs/modules/ROOT/pages/configuration/runtime-properties.adoc
@@ -23,6 +23,22 @@ kamel run -p my.message=test-property property-route.groovy
--dev
At runtime, that variable will be substituted by the value you've provided.
You can provide more than one single `property` at once by just adding the flag
repeatedly (ie, `--property prop1=val1 --property prop2=val2 ...`)
+You can also use runtime properties in Camel endpoints, for example to make
the timer
+period configurable you can do as follows:
+
+[source,groovy]
+.property-route.groovy
+----
+from('timer:property?period={{triggerPeriod}}')
+ .log('property content is: {{my.message}}')
+----
+
+The simplest way to replace that variable with a real value is to use the
`--property` flag (also shortcut by `-p`):
+
+----
+kamel run -p my.message=test-property -p triggerPeriod=3000
property-route.groovy --dev
+----
+
[[runtime-props-file]]
== Property File
@@ -59,4 +75,4 @@ If you have a property repeated more than once, the general
rule is that the las
[[runtime-build-time-conf]]
== Build time properties
-If you're looking for *build-time properties configuration* you can look at
the xref:configuration/build-time-properties.adoc[build-time properties]
section.
\ No newline at end of file
+If you're looking for *build-time properties configuration* you can look at
the xref:configuration/build-time-properties.adoc[build-time properties]
section.