...
Camel now provides a new PropertiesComponent
in camel-core which allows you to use property placeholders when defining Camel Endpoint URIs. This works much like you would do if using Spring's <property-placeholder>
tag. However Spring have has a limitation which that prevents 3rd party frameworks to leverage from fully leveraging Spring property placeholders to the fullest.
For more details see: How do I use Spring Property Placeholder with Camel XML.
...
The property placeholder is generally in use when doing any of the following:
- lookup or creating endpoints.
- lookup of beans in the Registry.
- additional supported in Spring XML (see below in examples).
- using Blueprint
PropertyPlaceholder
with Camel Properties component. - using
@PropertyInject
to inject a property in a POJO. - Camel 2.14.1 Using default value if a property does not exists.
- Camel 2.14.1 Include out of the box functions, to lookup property values from OS environment variables, JVM system properties, or the service idiom.
- Camel 2.14.1 Using custom functions, which can be plugged into the property component.
...
Info |
---|
From Camel 2.14.1: do not use a colon in the property key. The colon character is used as a token separator when providing a default value. |
Using PropertyResolver
Camel provides a pluggable mechanism which allows 3rd part to provide their own resolver to lookup properties. Camel provides a default implementation org.apache.camel.component.properties.DefaultPropertiesResolver
which is capable of loading properties from the file system, classpath or Registry. You can prefix the locations with either:
...