Hi, to do this, you have to use the blueprint ext. For instance:
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.2.0"> <ext:property-placeholder/> <bean ...> <property name="foo" value="${foo}"/> </beam> </blueprint> where foo is a system property defined with JVM arg like -Dfoo=bar Regards JB On 16/07/2018 15:46, glopez wrote: > Hi, > > I'm trying to work with environment variables (export foobar="linuxvar"), > this is what I have in my blueprint: > > <cm:property-placeholder persistent-id="ReadEnvVar" > placeholder-prefix="#GW(" placeholder-suffix=")"> > <cm:default-properties> > <cm:property name="message" value="${sysenv.foobar}" /> > </cm:default-properties> > </cm:property-placeholder> > > When I try to access the "message" value inside the camel context I have no > problem: > > <camelContext id="blueprintContext" trace="false" > xmlns="http://camel.apache.org/schema/blueprint"> > <route id="timerToLog"> > <from uri="timer:foo?period=5000"/> > <log message="1. {{message}}"/> > <to uri="mock:result"/> > </route> > </camelContext> > > I can see the "linuxvar" > > My problem is when I try to set a bean property using the message value: > > <bean id="myBean" class="beans.HelloBean"> > <property name="say" value="#GW(message)"/> > </bean> > > When I print the value of "say" I have "${sysenv.foobar}" instead of > "linuxvar". > > Any clue of what I'm doing wrong? > > Thanks > > > > -- > Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html > -- Jean-Baptiste Onofré [email protected] http://blog.nanthrax.net Talend - http://www.talend.com
