Using Property Placeholders for Any Kind of Attribute in the XML DSL in Camel
Issue
- How to configure
non-string attributeswithin theCamel XML DSLdynamically usingproperty placeholders? - When you try to configure a non-string attribute like
timeoutdynamically (through property file) you may face error like not a valid integer value for timeout -
Placeholders do not work for non-string values directly
-
We often use
pollEnrichin our routes and we need to set different timeouts. At the moment, in blueprint route, we can only set timeout as an int value, directly:
<pollEnrich timeout="50000">
<simple></simple>
</pollEnrich>
But we would like to be able to change this value dinamically from properties and then write something like:
<pollEnrich timeout="${pollEnrichTimeout}">
<simple></simple>
</pollEnrich>
- Here ${pollEnrichTimeout} is defined outside the route and we can adjust it as needed without the need to re-deploy the route.
- Tried both
${}and{ {} }placeholder but when Fuse try to deploy the route it fails and says that it is not a valid integer value for timeout.
Environment
- Red hat JBoss Fuse
- 6.x
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.
