Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
java
java
pc.setLocation("com/mycompany/myprop.properties,com/mycompany/other.properties");

Using system and environment variables in locations

Available as of Camel 2.7

The location now supports using placeholders for JVM system properties and OS environments variables.

For example:

Code Block

location=file:${karaf.home}/etc/foo.properties

In the location above we defined a location using the file scheme using the JVM system property with key karaf.home.

To use an OS environment variable instead you would have to prefix with env:

Code Block

location=file:${env:APP_HOME}/etc/foo.properties

Where APP_HOME is an OS environment.

You can have multiple placeholders in the same location, such as:

Code Block

location=file:${env:APP_HOME}/etc/${prop.name}.properties

Configuring in Java DSL

You have to create and register the PropertiesComponent under the name properties such as:

...