Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15087

toD doesn't resolve ${headers} if they come from a propertyPlaceholders

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1.0, 3.2.0, 3.3.0
    • 3.4.0
    • camel-core
    • None
    • Unknown

    Description

      From camel 3.1 and up, I have detected that <doD/> doesn't resolve variables in propertyPlaceholders.

      For example:

      if i have an etc/uri.properties with:

      example=http://${headers.url}

       

      And in camel Context xml:

       

      ...
      <camelContext id="example" xmlns="http://camel.apache.org/schema/spring">
      
         <propertyPlaceholder id="myProperties" location="classpath:etc/uri.properties"/>
      
         <route id="test">
           <from uri="timer:hello?period=3000"/>
      
           <setHeader name="url"><constant>www.google.es</constant></setHeader>
      
           <log message="{{example}}"/>
           <!-- It logs: http://www.google.es/ -->
      
           <toD uri="example"/>
           <!-- It resolves:  http://${headers.url} instead of http://www.google.es/ -->
        </route>
       </camelContext>
      

       
       
      But if i do a kind of a workarround like this, it works:

      ...
      <camelContext id="example" xmlns="http://camel.apache.org/schema/spring">
      
         <propertyPlaceholder id="myProperties" location="classpath:etc/uri.properties"/>
      
         <route id="test">
           <from uri="timer:hello?period=3000"/>
      
           <setHeader name="url"><constant>www.google.es</constant></setHeader>
      
           <setHeader name="workarround"><simple>{{example}}</simple></setHeader>
           <toD uri="${headers.workarround}"/>
           <!-- It now resolves:  http://www.google.es -->
        </route>
       </camelContext>
      

       

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            andreufontb Andreu Font Bardolet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: