Hi,
I have a set up where I maintain user properties in a properties file
[xyz.properties] and i store it in different directories based on
environment for eg dev/xyz.properties in dev and prod/xyz.properties in
prod.

Now, I pass the environment type using JVM param -Denv = prod/dev etc..
All these folders are in classpath.

So far, I have got the following things working with Camel -

1. Registering this property file using
           [code]
PropertiesComponent pc = new PropertiesComponent();
            pc.setLocation("classpath:${env}/xyz.properties");
            camelContext.addComponent("properties", pc);
[code]

2. I can look up end points dynamically using -
[code]
from("direct:email")
                .id("emailEP")
                .to("properties:{{smtp.address}}")
                .end();
[code]


However, I cannot look up properties for Simple expression evaluation . For
e.g
setHeader("From",simple("${properties:${env:env}/xyz.properties:alert.email.from}"))

I have tried alternatives such as
setHeader("From",simple("${properties:${env}/xyz.properties:alert.email.from}"))

Any clues on the correct way to look up. ?

Thanks.
Anand

Reply via email to