Dynamic URI too short documentation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Dynamic URI too short documentation

fliot33
Hi,

I spent hours to build dynamic URI with multiple parameters, header variables, and properties, both mixed.
I believe it worth to extend little bit this document:
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

typically using "{{myProperty}}" would not work, mixed with "${header.myVar}" values !!!!


I propose you put a complete example,

  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <value>classpath:camel.properties</value>
            <!-- where   "myProperty=SomePathToUse" -->
        </list>
    </property>
  </bean>

  <spring:camelContext>
     <routeContext>
       <route>
         <from uri="activemq:myQueue"/>
         <setHeader headerName="myVar"><xpath resultType="java.lang.String">/root/myVar</xpath></setHeader>
         <recipientList><simple>file:/somePath/${properties:myProperty}/${header.myVar}/someSubDir</simple></recipientList>
      </route>

...

Reply | Threaded
Open this post in threaded view
|

Re: Dynamic URI too short documentation

fliot33
I propose you put a complete example,

  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <value>classpath:camel.properties</value>
           
        </list>
    </property>
  </bean>

  <spring:camelContext>
     <routeContext>
       <route>
         <from uri="activemq:myQueue"/>
         <setHeader headerName="myVar"><xpath resultType="java.lang.String">/root/myVar</xpath></setHeader>
         <recipientList><simple>file:/somePath/${properties:myProperty}/${header.myVar}/someSubDir</simple></recipientList>
      </route>