This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • Using PropertyPlaceholder

Versions Compared


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


Code Block
PropertiesComponent pc = context.getComponent("properties", PropertiesComponent.class);
System.setProperty("cool.end", "mock:override");
System.setProperty("cool.result", "override");

context.addRoutes(new RouteBuilder() {
    public void configure() throws Exception {


template.sendBody("direct:start", "Hello World");
template.sendBody("direct:foo", "Hello Foo");


Unit tests

See the unit tests in camel-core and camel-spring


Using property placeholders for any kind of attribute in the XML DSL

Available as of Camel 2.7

Previously it was only the xs:string type attributes in the XML DSL that support placeholders. For example often a timeout attribute would be a xs:int type and thus you cannot set a string value as the placeholder key. This is now possible from Camel 2.7 onwards using a special placeholder namespace.

In the example below we use the prop prefix for the namespace by which we can use the prop prefix in the attributes in the XML DSLs. Notice how we use that in the Multicast to indicate that the option stopOnException should be the value of the placeholder with the key "stop".

Wiki Markup

In our properties file we have the value defined as

Code Block


Using property placeholder in the Java DSL

Available as of Camel 2.7

Likewise we have added support for defining placeholders in the Java DSL using the new placeholder DSL as shown in the following equivalent example:

Wiki Markup