搜索

此内容没有您所选择的语言版本。

Chapter 128. Properties

download PDF

Properties Component

Available as of Apache Camel 2.3

URI format

properties:key[?options]
Where key is the key for the property to lookup

Options

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.
encoding String null Camel 2.14.3/2.15.1: To use a specific charset to load the properties, such as UTF-8. By default ISO-8859-1 (latin1) is used.
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.
systemPropertiesMode int 2
Camel 2.16: The mode to use for whether to resolve and use system properties:
  • 0 = never (JVM system properties is never used),
  • 1 = fallback (JVM system properties is only used as fallback if no regular property with the key exists),
  • 2 = override (JVM system properties is used if exists, otherwise a the regular property will be used)
Note that when bridging this to Spring's property placeholder with org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer then the configuration on BridgePropertyPlaceholderConfigurer takes precedence over the configuration on the PropertiesComponent.
Resolving property from Java code
You can use the method resolvePropertyPlaceholders on the CamelContext to resolve a property from any Java code.

See also

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.