[[runtime-props]]
= Runtime properties

During the execution of an `Integration` you can provide a single property or a property file that will be made available at runtime.

[[runtime-single-prop]]
== Single property

Imagine you have a generic route and you set a placeholder for certain information (ie, _my.message_ variable):

[source,yaml]
.property-route.yaml
----
- from:
    uri: "timer:property"
    steps:
      - setBody:
          simple: "property content is: {{my.message}}"
      - to: "log:info"
----

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 property-route.yaml
----

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,yaml]
.config-property-route.yaml
----
- from:
    uri: "timer:property"
    parameters:
      period: "{{triggerPeriod}}"
    steps:
      - setBody:
          simple: "property content is: {{my.message}}"
      - to: "log:info"
----

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 config-property-route.yaml
----

[[runtime-props-file]]
== Property File

Another way to provide more property configuration at once is to use a *property file*.

[source,properties]
.config.properties
----
my.key.1=hello
my.key.2=world
----

[source,yaml]
.config-property-file-route.yaml
----
- from:
    uri: "timer:property-file'"
    steps:
      - setBody:
          simple: "property file content is: {{my.key.1}} {{my.key.2}}"
      - to: "log:info"
----

You'll need to provide a `property` _file_ flag when launching the application:

----
kamel run --property file:config.properties config-property-file-route.yaml
----

The property file is parsed and its properties configured on the `Integration`. As soon as the application starts, you will see the log with the expected configuration.

[[runtime-configmap]]
== Property from ConfigMap/Secret

In case some runtime properties are stored into a `Configmap` or a `Secret`, you can use the `--config` parameter with a value of type respectively _configmap:name-of-configmap_ or _secret:name-of-secret_ to refer to the specific resource to use as runtime properties. See more advanced details on the `mount` trait.

[[runtime-props-file-precedence]]
== Property collision priority

If you have a property repeated more than once, the general rule is that the last one declared in your `kamel run` statement will be taken in consideration. If the same property is found both in a single option declaration and inside a file, then, the single option will have higher priority and will be used.

[[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.
