Reputation: 283
I need to split the camel context definition into multiple files/projects. I'd like to have one file with only global configurations (like dataFormats, onCompletion handler, onException handler, interceptFrom, operational routes) and one file which builds on top of it defining mainly routes.
I have not found any way to adjust/extend a CamelContext definition done in another file. Is there a way?
It would look like this:
camel-core.xml:
<camelContext id="camelContext">
<interceptFrom>
<log message="{$routeId} started" />
</interceptFrom>
</camelContext>
camel-routes.xml:
<camelContext id="camelContext">
<route id="camelRoute1">
<from uri="vm:foo" />
<log message="camelRoute1 completed" />
</route>
</camelContext>
Desired output when running camelRoute1:
camelRoute1 started
camelRoute1 completed
Upvotes: 1
Views: 1760
Reputation: 283
I've found a workaround with the Java DSL for my case:
works :-)
Upvotes: 2
Reputation: 2255
It's possible to do this.
Use <import resource="myCoolRoutes.xml"/>
See documentation - http://camel.apache.org/how-do-i-import-routes-from-other-xml-files.html
Upvotes: -1