Wonderful, works just fine

        System.out.println("camel context ready: " + 
getContext().resolvePropertyPlaceholders("sayHi") );

-thanks


-----Original Message-----
From: Claus Ibsen [mailto:[email protected]] 
Sent: Wednesday, May 22, 2013 2:55 AM
To: [email protected]
Subject: Re: BridgePropertyPlaceholderConfigurer, could not get the properties, 
I searched the user forum but could not get the answer

CamelContext.getProperty is NOT for property placeholders.

You can use this method
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/CamelContext.html#resolvePropertyPlaceholders(java.lang.String)



On Wed, May 22, 2013 at 6:22 AM, Vegi, Vamsi (MAN-Corporate-CON) 
<[email protected]> wrote:
> Hello
> Can anyone provide some input:
>
> I am trying to access the properties defined in camel.properties file, 
> but I cannot access it, See below for details
>
>
> In my XML I have
>
> <bean id="bridgePropertyPlaceholder" 
> class="org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer">
>                 <property name="locations">
>                                 <list>
>                                                 
> <value>classpath:camel.properties</value>
>                                 </list>
>                 </property>
> </bean>
>
> <camelContext id="ovc-inbound-jms-camel-app" 
> xmlns="http://camel.apache.org/schema/spring";>
>                 <routeBuilder ref="companyMsgRouter" />
>                 <routeBuilder ref="repMsgRouter" />
>                 <routeBuilder ref="customerGrpMsgRouter" />
>                 <routeBuilder ref="relCustGrp2CompanyMsgRouter" /> 
> </camelContext> =====================================================
> In my code, I have
>
>
> public class CompanyMsgRouter  extends RouteBuilder{ // some variables 
> here
>
> @Override
>                 public void configure() throws Exception {
>                                 LOG.info("CompanyMsgRouter: configure 
> called");
>                 // some routes here
>                 System.out.println("camel context ready: " + 
> getContext().getProperty("sayHi") );  // =======> Does not work, I get a null 
> value
>                 } // end configure
>
> } // end class



--
Claus Ibsen
-----------------
www.camelone.org: The open source integration conference.

Red Hat, Inc.
FuseSource is now part of Red Hat
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen



Reply via email to