How to read properties from CamelContext in a Camel route
Issue
- I would like to read a property set in
CamelContextusing Camel's DSL language. - In Route #1 I will call a Java method where I will set a property
"ABC"intoexchange.getContext().setProperties(). In the sameCamelContextRoute #2 I would like to read the property value. -
I tried both of the following options, but they did not work:
<simple>{{ABC}} == 'true'</simple>or:
<simple>${properties:ABC} == 'true'</simple> -
The Simple expression
"${property.ABC}"does not work, as it refers to a property stored inExchange, not inCamelContext.
Environment
- Red Hat JBoss Fuse (Fuse)
- 6.x
- Red Hat JBoss Fuse Service Works (FSW)
- 6.0.x
- Apache Camel
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
