How to read properties from CamelContext in a Camel route
Issue
- I would like to read a property set in
CamelContext
using 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 sameCamelContext
Route #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, tools, and much more.