0

I am using Spring to load properties:

<util:properties id="service-properties">
        ...
        <prop key="postScript"></prop>
        ... 
</util:properties>

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" id="propertyConfigurer"><property name="properties" ref="service-properties" />
</bean>

However, one of the properties can have a value like the following (this is a camel xml simple language snippet):

postScript=<setBody><simple>${in.header.type}</simple></setBody>

The problem, is when I get the value of this property, it is:

postScript=<setBody><simple></simple></setBody>

I think it seems to be trying to resolve the ${in.header.type} variable, thinking it is a system variable maybe?

I'd like to know how to stop this variable being resolved? I've tried escaping it with quotes but no good.

Rory
  • 4,030
  • 4
  • 17
  • 21
  • Try the option mentioned in this link: http://stackoverflow.com/questions/13162346/escape-property-reference-in-spring-property-file – ColinMc Jun 26 '15 at 11:20

1 Answers1

0

Got an answer for this from the Camel docs :-)

http://camel.apache.org/simple.html

Alternative syntax

From Camel 2.5 onwards you can also use the alternative syntax which uses $simple{ } as placeholders. This can be used in situations to avoid clashes when using for example Spring property placeholder together with Camel.

Community
  • 1
  • 1
Rory
  • 4,030
  • 4
  • 17
  • 21