...
Properties
...
Component
...
Available from Camel 2.3
URI format
Code Block |
---|
*
h3. URI format
{code}
properties:key[?options]
{code}
Where *key* is the key for the property to lookup
h3. Options
{div:class=confluenceTableSmall}
|| Name || Type || Default || Description ||
| {{cache}} | {{boolean}} | {{true}} | Whether or not to cache loaded properties. |
| {{locations}} | {{String}} | {{null}} | A list of locations to load properties. You can use comma to separate multiple locations. This option will override any default locations and *only* use the locations from this option. |
| {{ignoreMissingLocation}} | {{boolean}} | {{false}} | *Camel 2.10:* Whether to silently ignore if a location cannot be located, such as a properties file not found. |
| {{propertyPrefix}} | {{String}} | {{null}} | *Camel 2.9* Optional prefix prepended to property names before resolution. |
| {{propertySuffix}} | {{String}} | {{null}} | *Camel 2.9* Optional suffix appended to property names before resolution. |
| {{fallbackToUnaugmentedProperty}} | {{boolean}} | {{true}} | *Camel 2.9* If true, first attempt resolution of property name augmented with {{propertyPrefix}} and {{propertySuffix}} before falling back the plain property name specified. If false, only the augmented property name is searched. |
| {{prefixToken}} | {{String}} | {{ \\ | *Camel 2.9* The token to indicate the beginning of a property token. |
| {{suffixToken}} | {{String}} | }} \\ | *Camel 2.9* The token to indicate the end of a property token. |
{div}
{tip:title=Resolving property from Java code}
You can use the method {{resolvePropertyPlaceholders}} on the {{CamelContext}} to resolve a property from any Java code.
{tip}
{include:Using PropertyPlaceholder}
{include:Endpoint See Also}
- [Jasypt] for using encrypted values (eg passwords) in the properties |
Where key
is the key for the property to be looked up.
Options
Div |
---|
class | confluenceTableSmall |
---|
|
Option | Type | Default | Description |
---|
cache
| boolean
| true
| Whether or not to cache loaded properties. | encoding
| String
| null
| Camel 2.14.3/2.15.1: The charset to use when loading properties, such as UTF-8 . The default charset is: ISO-8859-1 (latin1 ). | fallbackToUnaugmentedProperty
| boolean
| true
| Camel 2.9 If true , first attempt resolution of property name augmented with propertyPrefix and propertySuffix before falling back the plain property name specified. If false , only the augmented property name is searched. | defaultFallbackEnabled
| boolean
| true
| Camel 2.19: If false the component will not attempt to find a default for the key by looking after the colon separator. | ignoreMissingLocation
| boolean
| false
| Camel 2.10: Whether to silently ignore if a location cannot be located, such as a properties file not found. | locations
| String
| null
| A comma separated list of one or more locations of property files to be loaded. Property resolution will use the given property files exclusively. Any default location(s) are ignored. | prefixToken
| String
| {{
| Camel 2.9 This token is used to mark the start of a property placeholder definition. | propertyPrefix
| String
| null
| Camel 2.9 An optional prefix that's prepended to each property name prior to resolution. | propertySuffix
| String
| null
| Camel 2.9 An optional suffix that's appended to each property name prior to resolution. | suffixToken
| String
| }}
| Camel 2.9 This token is used to mark the end of a property placeholder definition. | systemPropertiesMode
| int
| 2
| Camel 2.16 The mode to use for whether to resolve and use system properties: 0 = never - JVM system properties are never used.
1 = fallback - JVM system properties are only used as fallback if no regular property with the key exists.
2 = override - JVM system properties are used if exists, otherwise the regular property will be used.
Warning |
---|
title | Bridging Spring and Camel Property Placeholders |
---|
| When bridging to Spring's property placeholder using org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer the configuration on BridgePropertyPlaceholderConfigurer will take precedence over the configuration on the PropertiesComponent . |
|
|
Tip |
---|
title | Resolving property from Java code |
---|
|
You can use the method resolvePropertyPlaceholders on the CamelContext to resolve a property from any Java code. |
Include Page |
---|
| Using PropertyPlaceholder |
---|
| Using PropertyPlaceholder |
---|
|
Include Page |
---|
| Endpoint See Also |
---|
| Endpoint See Also |
---|
|
- Jasypt for using encrypted values e.g., passwords, in properties.