Integration with Apache Camel (Extension Module)


The Tamaya Camel integration module provides different artifacts which allows integration of Apachae Tamaya configuration with Apache Camel.


The module is based on Java 7, so it will not run on Java 7 and beyond.


To benefit from configuration builder support you only must add the corresponding dependency to your module:


The Extensions Provided

Camel integration comes basically with three artifacts:

  • A Camel ResolverFunction implementation adding explicit property resolution (org.apache.tamaya.integration.camel.TamayaPropertyResolver).

  • A Camel PropertiesComponent implementation, which allows implicitly preconfigures the resolvers from above and additionally allows using Tamaya configuration as Camel overrides (org.apache.tamaya.integration.camel.TamayaPropertiesComponent).

Configuring using Camel Java DSL

Camel integration using Java DSL is basically simple:

import org.apache.tamaya.integration.camel.TamayaPropertiesComponent;

camelContext.addComponent("properties", new TamayaPropertiesComponent());

Given so you can then use cfg or tamaya as prefix for resolving entries with Tamaya as follows:

RouteBuilder builder = new RouteBuilder() {
    public void configure() {
builder = new RouteBuilder() {
    public void configure() {

Optionally you can also configure TamayaPropertiesComponent that all currently known Tamaya properties are used as Camel overrides, meaning they are evaluated prior to all other available resolver functions in the Camel PropertiesComponent:

TamayaPropertiesComponent props = new TamayaPropertiesComponent();

Configuring using Camel XML DSL

Camel integration using XML DSL is basically very similar. You just have to add the properties component as bean as well. All other configuration parameters (e.g. file URIs are similar supported). In the example code below we again use Tamaya as the main configuration solutions only using Camel’s default behaviour as a fallback:

<beans xmlns=""

    <routeContext id="myCoolRoutes" xmlns="">
        <route id="r1">
            <from uri="direct:hello1"/>
        <route id="r2">
            <from uri="direct:hello2"/>
        <route id="r3">
            <from uri="direct:hello3"/>

    <bean id="properties" class="org.apache.tamaya.integration.camel.TamayaPropertiesComponent">
        <property name="tamayaOverrides" value="true"/>

Last updated 2016-07-13 23:25:59 +02:00

Back to top

Version: 0.3-incubating-SNAPSHOT. Last Published: 2016-07-13.

Reflow Maven skin by Andrius Velykis.