You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by saiya-jin <ma...@barclayswealth.com> on 2012/02/22 11:12:20 UTC

Passing environment variable to URI in Spring XML

Hello,
I googled quite a lot, but I didn't find something that would work for me.
Situation is pretty simple:
I need to use a JVM variable (passed when launching process with
"-Dtopdir=XXX") of current folder where app is residing. Because of a way
app is installed (symlinks to launch scripts etc) I cannot use simple path
in URI like "file://my_beloved_folder", because this will be looked for in
place where start script is, not where whole app is installed. But passing
env variable works, at least for spring part of config. 
But I cannot find any solution for Camel routing using it in this way:

<camel:to uri="file://#{systemProperties.topdir}/my_beloved_folder" />

Of course this is not good (its Spring way), but what could work? Just to
clarify it should route all messages that fullfill some criteria into this
folder.

Thank You for any help.

Martin

--
View this message in context: http://camel.465427.n5.nabble.com/Passing-environment-variable-to-URI-in-Spring-XML-tp5504710p5504710.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Passing environment variable to URI in Spring XML

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

See this FAQ
http://camel.apache.org/how-do-i-use-spring-property-placeholder-with-camel-xml.html

On Wed, Feb 22, 2012 at 11:12 AM, saiya-jin
<ma...@barclayswealth.com> wrote:
> Hello,
> I googled quite a lot, but I didn't find something that would work for me.
> Situation is pretty simple:
> I need to use a JVM variable (passed when launching process with
> "-Dtopdir=XXX") of current folder where app is residing. Because of a way
> app is installed (symlinks to launch scripts etc) I cannot use simple path
> in URI like "file://my_beloved_folder", because this will be looked for in
> place where start script is, not where whole app is installed. But passing
> env variable works, at least for spring part of config.
> But I cannot find any solution for Camel routing using it in this way:
>
> <camel:to uri="file://#{systemProperties.topdir}/my_beloved_folder" />
>
> Of course this is not good (its Spring way), but what could work? Just to
> clarify it should route all messages that fullfill some criteria into this
> folder.
>
> Thank You for any help.
>
> Martin
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Passing-environment-variable-to-URI-in-Spring-XML-tp5504710p5504710.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/