Hi Ben;

Charles Mouillard from Camel has blog this:
http://cmoulliard.blogspot.com/2009/05/trick-to-pass-uri-declared-in-property.html

Anyway, if you can use property directly into Camel URIs, you can use endpoint definition like this:
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
    ">

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

  <camelContext xmlns="http://activemq.apache.org/camel/schema/spring";>
    <endpoint id="input1" uri="activemq:${someQueueName}"/>

    <route>
      <from ref="input1"/>
      <to uri="activemq:OutputQueue"/>
    </route>
  </camelContext>


</beans>

Regards
JB

boday wrote:
I need to dynamically configure some Camel route properties (http endpoint
URL, etc) based on a properties file.  What is the best way to do this?

I thought I could create a local.properties file and use Spring's
PropertyPlaceholderConfigurer, but I'm not sure how this works with Camel
DSL exactly...

here is what I have today...

local.properties file with a property "inboundURL=http://test.com";

MyRouteBuilder.java with a hardcoded URL

String inboundURL = "http://test.com";   //TODO: need to be from prop file
...
from("jetty:" + inboundURL)
.to("activemq:GatewayMsgQueue");
...

thanks

-----
Ben O'Day
Vektrel - Senior Consultant


--
Jean-Baptiste Onofré (Nanthrax)
BuildProcess/AutoDeploy Project Leader
http://buildprocess.sourceforge.net
[email protected]
PGP : 17D4F086

Reply via email to