The userName and password are charged by Spring. You can use BridgePropertyPlaceholderConfigurer[1] to bridge the properties between Spring and Camel.
[1]http://camel.apache.org/properties.html#Properties-BridgingSpringandCamelpropertyplaceholders -- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, November 7, 2013 at 2:34 PM, CamelTyro wrote: > In a property file, I config the username and password, besides the endpoint > url, as below > #This used to access the activemq > userName=system > password=manager > #This used to set the url of endpoint > url1=restlet:/rs/his/... > url2=... > > I config the router by {{url1}}, and the activemq infomation > with{{userName}}, {{password}} > <bean id="activemqTCP" > class="org.apache.activemq.camel.component.ActiveMQComponent"> > <property name="preserveMessageQos" value="true"></property> > <property name="transacted" value="true" /> > <property name="transactionManager" ref="txManager" /> > <property name="userName" value="{{userName}}" /> > <property name="password" value="{{password}}" /> > </bean> > when routing, it tell me "UncategorizedJmsException" Occured, but without > the placeholder, using the plain text in config file worked well. as below > <bean id="activemqTCP" > class="org.apache.activemq.camel.component.ActiveMQComponent"> > <property name="preserveMessageQos" value="true"></property> > <property name="transacted" value="true" /> > <property name="transactionManager" ref="txManager" /> > <property name="userName" value="system" /> > <property name="password" value="manager" /> > </bean> > > So I want to know whether the camel property component can used for config > the information not for routing. And whether the expression {{XXX}} only be > parsed when router buliding. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/how-to-use-the-org-apache-camel-component-properties-PropertiesComponent-tp5742750p5742757.html > Sent from the Camel - Users mailing list archive at Nabble.com > (http://Nabble.com).