You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "harmohan.singh" <ha...@news.com.au> on 2014/11/19 03:31:20 UTC

How to get Spring System Environment variables in camel properties

i want to pass environment variables (O/S environment variables) to camel
routes. something like,

 <route id="route1" prop:autoStartup="{{env.shoudIStart}}" />

similar to how the values are set for configuring properties location:
location=file:${env:APP_HOME}/etc/foo.properties

but, since that doesnt work. i thought of using spring systemEnvironment to
get the value:
#{systemEnvironment['shouldIStart']}  like
{{systemEnvironment['shouldIStart']}}
but it looks like the syntax {{}} is only configured with ${} and not #{}

is there another way to pass the env variables to routes



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-get-Spring-System-Environment-variables-in-camel-properties-tp5759281.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to get Spring System Environment variables in camel properties

Posted by "harmohan.singh" <ha...@news.com.au>.
do you mean

> However Spring have a limitation which prevents 3rd party frameworks to
> leverage Spring property placeholders to the fullest

yea, i got that



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-get-Spring-System-Environment-variables-in-camel-properties-tp5759281p5759338.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to get Spring System Environment variables in camel properties

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

See the info box on the top of this page
http://camel.apache.org/using-propertyplaceholder.html

On Wed, Nov 19, 2014 at 3:31 AM, harmohan.singh
<ha...@news.com.au> wrote:
> i want to pass environment variables (O/S environment variables) to camel
> routes. something like,
>
>  <route id="route1" prop:autoStartup="{{env.shoudIStart}}" />
>
> similar to how the values are set for configuring properties location:
> location=file:${env:APP_HOME}/etc/foo.properties
>
> but, since that doesnt work. i thought of using spring systemEnvironment to
> get the value:
> #{systemEnvironment['shouldIStart']}  like
> {{systemEnvironment['shouldIStart']}}
> but it looks like the syntax {{}} is only configured with ${} and not #{}
>
> is there another way to pass the env variables to routes
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-get-Spring-System-Environment-variables-in-camel-properties-tp5759281.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: How to get Spring System Environment variables in camel properties

Posted by "harmohan.singh" <ha...@news.com.au>.
Work around: 
set jvm variable from environment variable

so, my config was
-DshoudIStart=${shoudIStart}

<route id="route1" autoStartup="{{shoudIStart}}" />




--
View this message in context: http://camel.465427.n5.nabble.com/How-to-get-Spring-System-Environment-variables-in-camel-properties-tp5759281p5759283.html
Sent from the Camel - Users mailing list archive at Nabble.com.