You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by terminator_008 <an...@intuit.com> on 2009/11/11 02:09:16 UTC

using properties file

Hi, I am reading some values from a property file in the camel -config.
I want to be able to use ${dev2hub1odepatientservice.uri} in the Pipeline
set header element. But it does not work.
Here is my camel-config file. Would appreciate any pointers.
       <bean id="test"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
       <property name="location" value="classpath:camel-dev.properties" />

    </bean>
  <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
      <endpoint id="devOdePatientService"
uri="${dev2hub1odepatientservice.uri}"></endpoint>
		 <route errorHandlerRef="myDeadLetterErrorHandler">
			 <from
uri="activemq:topic:topic.PATIENT?clientId=camelClientPatient&amp;durableSubscriptionName=patientTopicSubscriber"/>
             <to uri="bean:soapMessageCreator"/>
    	     <multicast >
 		   	     <pipeline>
				    <setHeader headerName="endpointURL">
					  <constant>${dev2hub1odepatientservice.uri}</constant>
				    </setHeader>
				    <to ref="devOdePatientService"/>
			     </pipeline>
		     </multicast>
        </route>
        <route>
      <from uri="activemq:topic:topic.TEST1"/>
      <to uri="activemq:topic:topic.TEST"/>
    </route>
      	   
  </camelContext>
-- 
View this message in context: http://old.nabble.com/using-properties-file-tp26294386p26294386.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: using properties file

Posted by terminator_008 <an...@intuit.com>.
Hi,
I am able to use create the endpoints by reading the values from properties
file as 
<endpoint id="devOdePatientService"
uri="${dev2hub1odepatientservice.uri}"></endpoint>

However I am not able to set the value of the endpoint uri
(${dev2hub1odepatientservice.uri}) in the header which is a requirement in
my case.
Can you please suggest how this can be achieved.

	     <pipeline>
				    <setHeader headerName="endpointURL">
					  <constant>${dev2hub1odepatientservice.uri}</constant>
				    </setHeader>
				    <to ref="devOdePatientService"/>
			     </pipeline>



tide08 wrote:
> 
> It is known issue, you cannot use properties in camelContext tag but there
> are ways to achieve this. See below thread for more details -
> 
> http://old.nabble.com/reading-endpoints-from-a-properties-file-td25894947.html#a25895352
> 
> Thanks!
> 
> 
> terminator_008 wrote:
>> 
>> Hi, I am reading some values from a property file in the camel -config.
>> I want to be able to use ${dev2hub1odepatientservice.uri} in the Pipeline
>> set header element. But it does not work.
>> Here is my camel-config file. Would appreciate any pointers.
>>        <bean id="test"
>> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>>        <property name="location" value="classpath:camel-dev.properties"
>> />
>> 
>>     </bean>
>>   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>>       <endpoint id="devOdePatientService"
>> uri="${dev2hub1odepatientservice.uri}"></endpoint>
>> 		 <route errorHandlerRef="myDeadLetterErrorHandler">
>> 			 <from
>> uri="activemq:topic:topic.PATIENT?clientId=camelClientPatient&amp;durableSubscriptionName=patientTopicSubscriber"/>
>>              <to uri="bean:soapMessageCreator"/>
>>     	     <multicast >
>>  		   	     <pipeline>
>> 				    <setHeader headerName="endpointURL">
>> 					  <constant>${dev2hub1odepatientservice.uri}</constant>
>> 				    </setHeader>
>> 				    <to ref="devOdePatientService"/>
>> 			     </pipeline>
>> 		     </multicast>
>>         </route>
>>         <route>
>>       <from uri="activemq:topic:topic.TEST1"/>
>>       <to uri="activemq:topic:topic.TEST"/>
>>     </route>
>>       	   
>>   </camelContext>
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/using-properties-file-tp26294386p26294434.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: using properties file

Posted by tide08 <sa...@yahoo.com>.
It is known issue, you cannot use properties in camelContext tag but there
are ways to achieve this. See below thread for more details -

http://old.nabble.com/reading-endpoints-from-a-properties-file-td25894947.html#a25895352

Thanks!


terminator_008 wrote:
> 
> Hi, I am reading some values from a property file in the camel -config.
> I want to be able to use ${dev2hub1odepatientservice.uri} in the Pipeline
> set header element. But it does not work.
> Here is my camel-config file. Would appreciate any pointers.
>        <bean id="test"
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>        <property name="location" value="classpath:camel-dev.properties" />
> 
>     </bean>
>   <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>       <endpoint id="devOdePatientService"
> uri="${dev2hub1odepatientservice.uri}"></endpoint>
> 		 <route errorHandlerRef="myDeadLetterErrorHandler">
> 			 <from
> uri="activemq:topic:topic.PATIENT?clientId=camelClientPatient&amp;durableSubscriptionName=patientTopicSubscriber"/>
>              <to uri="bean:soapMessageCreator"/>
>     	     <multicast >
>  		   	     <pipeline>
> 				    <setHeader headerName="endpointURL">
> 					  <constant>${dev2hub1odepatientservice.uri}</constant>
> 				    </setHeader>
> 				    <to ref="devOdePatientService"/>
> 			     </pipeline>
> 		     </multicast>
>         </route>
>         <route>
>       <from uri="activemq:topic:topic.TEST1"/>
>       <to uri="activemq:topic:topic.TEST"/>
>     </route>
>       	   
>   </camelContext>
> 

-- 
View this message in context: http://old.nabble.com/using-properties-file-tp26294386p26294431.html
Sent from the Camel - Users mailing list archive at Nabble.com.