You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by souciance <so...@gmail.com> on 2016/08/02 17:02:00 UTC
Referencing property file through environment variable
Hello,
Inside a routebuilder class in the config method I am trying to refer to a
property file using an environment variable like this:
PropertiesComponent pc = new PropertiesComponent();
pc.setLocation("${env:HOSTNAME}.cfg");
This is on a windows machine.
The environment variable HOSTNAME has the value system.local and hence the
file is called systme.local.cfg.
However, when I print the location of the file it shows me the uri pattern
and not the actual filename.
System.out.println("PROP LOCATION " + pc.getLocations()[0]);
Also, when I try to refer to a key in the property file as such:
${properties:test}
Camel throws an error saying it cannot find that key which makes me think it
didn't locate the property file.
What am I missing?
Thanks
Souciance
--
View this message in context: http://camel.465427.n5.nabble.com/Referencing-property-file-through-environment-variable-tp5785899.html
Sent from the Camel - Users mailing list archive at Nabble.com.